nglist.c File Reference

#include
#include "nntpgrab_utils.h"

Functions

NGList *  ng_list_append (NGList *list, void *data)
  Append an item to a list.
NGList *  ng_list_prepend (NGList *list, void *data)
  Insert an item to the beginning of a list.
NGList *  ng_list_remove (NGList *list, void *data)
  Remove an item from a list.
unsigned int  ng_list_length (NGList *list)
  Retrieve the length of a list.
void  ng_list_free (NGList *list)
  Free a list.
void  ng_free (void *data)
  Free data allocated by NNTPGrab functions.

Function Documentation

void ng_free ( void *  data  ) 

Free data allocated by NNTPGrab functions.

Parameters:
data  The data which needs to be free'd

NGList* ng_list_append ( NGList *  list,
void *  data  
)

Append an item to a list.

Parameters:
list  The list where the item needs to be added to (can be NULL to create a new list)
data  The item which needs to be added
Returns:
The (possibly) new start of the list

void ng_list_free ( NGList *  list  ) 

Free a list.

Parameters:
list  The list which needs to be free'd
Note:
This function only free's the list itself, NOT the items which were in it!

unsigned int ng_list_length ( NGList *  list  ) 

Retrieve the length of a list.

Parameters:
list  The list of which the length must be returned
Returns:
The length of the list

NGList* ng_list_prepend ( NGList *  list,
void *  data  
)

Insert an item to the beginning of a list.

Parameters:
list  The list where the item needs to be added to (can be NULL to create a new list)
data  The item which needs to be added
Returns:
The (possibly) new start of the list

NGList* ng_list_remove ( NGList *  list,
void *  data  
)

Remove an item from a list.

Parameters:
list  The list where the item needs to be removed from
data  The item which needs to be removed
Returns:
The (possibly) new start of the list
Note:
If data isn't part of the list, this function will do nothing


Generated on Thu May 21 21:25:05 2009 for NNTPGrab by  1.5.4