list
[utils]

List object. More...


Typedefs

typedef struct _tag_array GF_List

Functions

GF_List * gf_list_new ()
 list constructor
void gf_list_del (GF_List *ptr)
 list destructor
u32 gf_list_count (GF_List *ptr)
 get count
GF_Err gf_list_add (GF_List *ptr, void *item)
 add item
GF_Err gf_list_insert (GF_List *ptr, void *item, u32 position)
 inserts item
GF_Err gf_list_rem (GF_List *ptr, u32 position)
 removes item
void * gf_list_get (GF_List *ptr, u32 position)
 gets item
s32 gf_list_find (GF_List *ptr, void *item)
 finds item
s32 gf_list_del_item (GF_List *ptr, void *item)
 deletes item
void gf_list_reset (GF_List *ptr)
 resets list
void * gf_list_last (GF_List *ptr)
 gets last item
GF_Err gf_list_rem_last (GF_List *ptr)
 removes last item
void * gf_list_enum (GF_List *ptr, u32 *pos)
 list enumerator


Detailed Description

This section documents the list object of the GPAC framework.

Function Documentation

GF_List* gf_list_new (  ) 

Constructs a new list object

Returns:
new list object

void gf_list_del ( GF_List *  ptr  ) 

Destructs a list object

Parameters:
ptr list object to destruct
Note:
It is the caller responsability to destroy the content of the list if needed

u32 gf_list_count ( GF_List *  ptr  ) 

Returns number of items in the list

Parameters:
ptr target list object
Returns:
number of items in the list

GF_Err gf_list_add ( GF_List *  ptr,
void *  item 
)

Adds an item at the end of the list

Parameters:
ptr target list object
item item to add

GF_Err gf_list_insert ( GF_List *  ptr,
void *  item,
u32  position 
)

Insert an item in the list

Parameters:
ptr target list object
item item to add
position insertion position. It is expressed between 0 and gf_list_count-1, and any bigger value is equivalent to gf_list_add

GF_Err gf_list_rem ( GF_List *  ptr,
u32  position 
)

Removes an item from the list given its position

Parameters:
ptr target list object
position position of the item to remove. It is expressed between 0 and gf_list_count-1.
Note:
It is the caller responsability to destroy the content of the list if needed

void* gf_list_get ( GF_List *  ptr,
u32  position 
)

Gets an item from the list given its position

Parameters:
ptr target list object
position position of the item to get. It is expressed between 0 and gf_list_count-1.

s32 gf_list_find ( GF_List *  ptr,
void *  item 
)

Finds an item in the list

Parameters:
ptr target list object.
item the item to find.
Returns:
0-based item position in the list, or -1 if the item could not be found.

s32 gf_list_del_item ( GF_List *  ptr,
void *  item 
)

Deletes an item from the list

Parameters:
ptr target list object.
item the item to find.
Returns:
0-based item position in the list before removal, or -1 if the item could not be found.

void gf_list_reset ( GF_List *  ptr  ) 

Resets the content of the list

Parameters:
ptr target list object.
Note:
It is the caller responsability to destroy the content of the list if needed

void* gf_list_last ( GF_List *  ptr  ) 

Gets last item o fthe list

Parameters:
ptr target list object

GF_Err gf_list_rem_last ( GF_List *  ptr  ) 

Removes the last item of the list

Parameters:
ptr target list object
Note:
It is the caller responsability to destroy the content of the list if needed

void* gf_list_enum ( GF_List *  ptr,
u32 *  pos 
)

Retrieves given list item and increment current position

Parameters:
ptr target list object
pos target item position. The position is automatically incremented regardless of the return value
Note:
A typical enumeration will start with a value of 0 until NULL is returned.


Generated on Mon Feb 23 09:12:33 2009 for libgpac by  doxygen 1.5.7.1