Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

slist.h File Reference

#include "common.h"
#include "glib-missing.h"

Go to the source code of this file.

Typedefs

typedef slist_iter slist_iter_t
typedef slist slist_t

Functions

slist_tslist_new (void)
 Create a new slist.
void slist_free (slist_t **slist_ptr)
 Dispose of the data structure.
gboolean slist_remove (slist_t *slist, gpointer key)
 Remove `key' from the slist.
gpointer slist_shift (slist_t *slist)
 Remove first item from the slist, if any.
void slist_append (slist_t *slist, gpointer key)
 Append `key' to the slist.
void slist_prepend (slist_t *slist, gpointer key)
 Prepend `key' to the slist.
void slist_insert_sorted (slist_t *slist, gpointer key, GCompareFunc func)
 Insert `key' into the slist.
gboolean slist_moveto_head (slist_t *slist, gpointer key)
 Move entry to the head of the slist.
gboolean slist_moveto_tail (slist_t *slist, gpointer key)
 Move entry to the tail of the slist.
gpointer slist_head (const slist_t *slist)
gpointer slist_tail (const slist_t *slist)
guint slist_length (const slist_t *slist)
gboolean slist_contains (const slist_t *slist, gconstpointer key, GEqualFunc func, gpointer *orig_key)
 Check whether slist contains the `key' whereas equality is determined using `func'.
gboolean slist_contains_identical (const slist_t *slist, gconstpointer key)
 Check whether slist contains the `key'.
void slist_foreach (const slist_t *slist, GFunc func, gpointer user_data)
 Apply `func' to all the items in the structure.
slist_iter_tslist_iter_on_head (slist_t *slist)
 Get an iterator on the slist, positioned on the first item.
slist_iter_tslist_iter_before_head (slist_t *slist)
 Get an iterator on the slist, positioned before the first item.
void slist_iter_free (slist_iter_t **iter_ptr)
 Release the iterator once we're done with it.
gboolean slist_iter_has_item (const slist_iter_t *iter)
 Checks whether there is an item at the current position.
gboolean slist_iter_has_next (const slist_iter_t *iter)
gpointer slist_iter_next (slist_iter_t *iter)
 Moves the iterator to the next element and returns its value.
gpointer slist_iter_current (const slist_iter_t *iter)
void slist_iter_remove (slist_iter_t *iter)
 Removes the item at the current position and moves the iterator to the next item.


Typedef Documentation

typedef struct slist_iter slist_iter_t
 

typedef struct slist slist_t
 


Function Documentation

void slist_append slist_t slist,
gpointer  key
 

Append `key' to the slist.

gboolean slist_contains const slist_t slist,
gconstpointer  key,
GEqualFunc  func,
gpointer *  orig_key
 

Check whether slist contains the `key' whereas equality is determined using `func'.

gboolean slist_contains_identical const slist_t slist,
gconstpointer  key
 

Check whether slist contains the `key'.

void slist_foreach const slist_t slist,
GFunc  func,
gpointer  user_data
 

Apply `func' to all the items in the structure.

void slist_free slist_t **  slist_ptr  ) 
 

Dispose of the data structure.

gpointer slist_head const slist_t slist  ) 
 

Returns:
the first item of the slist, or NULL if none.

void slist_insert_sorted slist_t slist,
gpointer  key,
GCompareFunc  func
 

Insert `key' into the slist.

slist_iter_t* slist_iter_before_head slist_t slist  ) 
 

Get an iterator on the slist, positioned before the first item.

gpointer slist_iter_current const slist_iter_t iter  ) 
 

void slist_iter_free slist_iter_t **  iter_ptr  ) 
 

Release the iterator once we're done with it.

gboolean slist_iter_has_item const slist_iter_t iter  ) 
 

Checks whether there is an item at the current position.

gboolean slist_iter_has_next const slist_iter_t iter  ) 
 

gpointer slist_iter_next slist_iter_t iter  ) 
 

Moves the iterator to the next element and returns its value.

If there is no next element, NULL is returned.

slist_iter_t* slist_iter_on_head slist_t slist  ) 
 

Get an iterator on the slist, positioned on the first item.

void slist_iter_remove slist_iter_t iter  ) 
 

Removes the item at the current position and moves the iterator to the next item.

guint slist_length const slist_t slist  ) 
 

Returns:
the length of the slist.

gboolean slist_moveto_head slist_t slist,
gpointer  key
 

Move entry to the head of the slist.

gboolean slist_moveto_tail slist_t slist,
gpointer  key
 

Move entry to the tail of the slist.

slist_t* slist_new void   ) 
 

Create a new slist.

void slist_prepend slist_t slist,
gpointer  key
 

Prepend `key' to the slist.

gboolean slist_remove slist_t slist,
gpointer  key
 

Remove `key' from the slist.

Returns:
TRUE if the given key was found and remove, FALSE otherwise.

gpointer slist_shift slist_t slist  ) 
 

Remove first item from the slist, if any.

Returns:
the data pointer of the removed item, or NULL if there was no item.

gpointer slist_tail const slist_t slist  ) 
 

Returns:
The data associated with the tail item, or NULL if none.


Generated on Sat Jun 30 17:53:30 2007 for gtk-gnutella by  doxygen 1.3.9.1