GEL  0.99
Utilities Functions

Functions

int gel_list_empty (gel_list_t a)
 
gel_list_t gel_list_new (void)
 
void gel_list_first (gel_list_t desc)
 
int gel_list_end (gel_list_t desc)
 
void * gel_list_get (gel_list_t desc)
 
int gel_list_contains (gel_list_t desc, void *val)
 
int gel_list_add (gel_list_t desc, void *val)
 
void gel_list_clear (gel_list_t desc)
 
void gel_list_delete (gel_list_t desc)
 
void gel_list_delete_items (gel_list_t desc, void(*free_func)(void *))
 
int gel_list_length (gel_list_t desc)
 
int gel_list_remove (gel_list_t desc, void *val)
 

Detailed Description

This module provides several utilities function and data structure to represent and handle efficiently data of the ELF files.

Function Documentation

◆ gel_list_add()

int gel_list_add ( gel_list_t  desc,
void *  val 
)

Add an element to the list (without adding two times the same element).

Parameters
descList to add to.
valValue to add.
Returns
0 for success, -1 if there is no more memory.

◆ gel_list_clear()

void gel_list_clear ( gel_list_t  desc)

Remove all elements from the list.

Parameters
descList to clear.

◆ gel_list_contains()

int gel_list_contains ( gel_list_t  desc,
void *  val 
)

Test if an element is in the list.

Parameters
descList to look in.
valLooked item.
Returns
1 if the item is in, 0 else.

◆ gel_list_delete()

void gel_list_delete ( gel_list_t  desc)

Delete the list.

Parameters
descList to delete.

◆ gel_list_delete_items()

void gel_list_delete_items ( gel_list_t  desc,
void(*)(void *)  free_func 
)

Delete the items of the list with the given function.

Parameters
descList to clear.
free_funcFunction used to delete the items.

◆ gel_list_empty()

int gel_list_empty ( gel_list_t  a)

Test if a list is empty.

Parameters
aList to test.
Returns
1 if the list is empty, false.

◆ gel_list_end()

int gel_list_end ( gel_list_t  desc)

Test if the end of the list is reached.

Parameters
descList to test.
Returns
1 if the end is reached, 0 else.

◆ gel_list_first()

void gel_list_first ( gel_list_t  desc)

Move to the start of the list.

Parameters
descList to move on.

◆ gel_list_get()

void* gel_list_get ( gel_list_t  desc)

Get the value of the current element of the list. Then go to the next element.

Parameters
descList to get element of.
Returns
Got element or null (if at end).

◆ gel_list_length()

int gel_list_length ( gel_list_t  desc)

Get the length (number of elements) in the list.

Parameters
descList to get length of.
Returns
List length.

◆ gel_list_new()

gel_list_t gel_list_new ( void  )

Build a new linked list.

Returns
New list or null.

◆ gel_list_remove()

int gel_list_remove ( gel_list_t  desc,
void *  val 
)

Remove an element from the list.

Parameters
descList to remove from.
valElement to remove.
Returns
1 if the element is in the list, 0 else.