Galago - desktop presence framework

galago-list.h File Reference

List API. More...

#include <libgalago/galago-types.h>

Go to the source code of this file.


Typedefs

typedef _GalagoList GalagoList

Functions

GalagoListgalago_list_new (void)
 Creates a new linked list node.
void galago_list_destroy (GalagoList *list)
 Destroys a linked list.
void galago_list_destroy_1 (GalagoList *list)
 Destroys a single node in a linked list.
GalagoListgalago_list_dup (const GalagoList *list)
 Duplicates a list.
GalagoListgalago_list_append (GalagoList *list, void *data)
 Appends data to a linked list.
GalagoListgalago_list_prepend (GalagoList *list, void *data)
 Prepends data to a linked list.
GalagoListgalago_list_remove (GalagoList *list, void *data)
 Removes data and its node from a linked list.
GalagoListgalago_list_remove_link (GalagoList *list, GalagoList *link)
 Unlinks a node from a linked list.
GalagoListgalago_list_delete_link (GalagoList *list, GalagoList *link)
 Unlinks and deletes a node from a linked list.
GalagoListgalago_list_find (GalagoList *list, void *data)
 Finds the node in a linked list with the specified data.
void galago_list_foreach (const GalagoList *list, GalagoForEachFunc func, void *user_data)
 Calls a function on each node in a linked list.
GalagoListgalago_list_get_first (GalagoList *list)
 Returns the first node in a linked list.
GalagoListgalago_list_get_last (GalagoList *list)
 Returns the last node in a linked list.
GalagoListgalago_list_get_prev (GalagoList *list)
 Returns the previous node in a linked list.
GalagoListgalago_list_get_next (GalagoList *list)
 Returns the next node in a linked list.
void * galago_list_get_data (GalagoList *list)
 Returns the data in a node in a linked list.
size_t galago_list_get_count (const GalagoList *list)
 Returns the number of nodes in a linked list.

Detailed Description

List API.

Copyright:
(C) 2004-2005 Christian Hammond.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file galago-list.h.


Function Documentation

GalagoList* galago_list_append GalagoList list,
void *  data
 

Appends data to a linked list.

Parameters:
list The start of the linked list.
data The data to append.
Returns:
The new beginning of the linked list.

GalagoList* galago_list_delete_link GalagoList list,
GalagoList link
 

Unlinks and deletes a node from a linked list.

Parameters:
list The linked list.
link The link to unlink and destroy.
Returns:
The new start of the linked list.

void galago_list_destroy GalagoList list  ) 
 

Destroys a linked list.

The data inside the list will not be destroyed.

Parameters:
list The first node in the linked list.

void galago_list_destroy_1 GalagoList list  ) 
 

Destroys a single node in a linked list.

The node will not be unlinked. Use galago_list_delete_link() for that.

Parameters:
list The linked list node.

GalagoList* galago_list_dup const GalagoList list  ) 
 

Duplicates a list.

Parameters:
list The source list.
Returns:
The new list.

GalagoList* galago_list_find GalagoList list,
void *  data
 

Finds the node in a linked list with the specified data.

Parameters:
list The linked list.
data The data contained in the node.
Returns:
The linked list node, if found, or NULL.

void galago_list_foreach const GalagoList list,
GalagoForEachFunc  func,
void *  user_data
 

Calls a function on each node in a linked list.

Parameters:
list The linked list.
func The function to call.
user_data User-specified data to pass to the function.

size_t galago_list_get_count const GalagoList list  ) 
 

Returns the number of nodes in a linked list.

Parameters:
list The linked list.
Returns:
The number of nodes in the linked list.

void* galago_list_get_data GalagoList list  ) 
 

Returns the data in a node in a linked list.

Parameters:
list The current node in the linked list.
Returns:
The data in the node.

GalagoList* galago_list_get_first GalagoList list  ) 
 

Returns the first node in a linked list.

Parameters:
list The linked list.
Returns:
The first node in the linked list.

GalagoList* galago_list_get_last GalagoList list  ) 
 

Returns the last node in a linked list.

Parameters:
list The linked list.
Returns:
The last node in the linked list.

GalagoList* galago_list_get_next GalagoList list  ) 
 

Returns the next node in a linked list.

Parameters:
list The current node in the linked list.
Returns:
The next item in the list.

GalagoList* galago_list_get_prev GalagoList list  ) 
 

Returns the previous node in a linked list.

Parameters:
list The current node in the linked list.
Returns:
The previous item in the list.

GalagoList* galago_list_new void   ) 
 

Creates a new linked list node.

Returns:
The linked list node.

GalagoList* galago_list_prepend GalagoList list,
void *  data
 

Prepends data to a linked list.

Parameters:
list The start of the linked list.
data The data to prepend.
Returns:
The new beginning of the linked list.

GalagoList* galago_list_remove GalagoList list,
void *  data
 

Removes data and its node from a linked list.

Parameters:
list The start of the linked list.
data The data to remove.
Returns:
The new beginning of the linked list.

GalagoList* galago_list_remove_link GalagoList list,
GalagoList link
 

Unlinks a node from a linked list.

This will not destroy the node.

Parameters:
list The linked list.
link The node to unlink.
Returns:
The new start of the linked list.