2 The oSIP library implements the Session Initiation Protocol (SIP -rfc2543-)
3 Copyright (C) 2001 Aymeric MOIZARD jack@atosc.org
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 * @brief oSIP list Routines
32 * This is a very simple implementation of a linked list.
33 * <BR>There is not much to say about it... Except that it
34 * could be a lot improved. Sadly, it would be difficult
35 * to improve it without breaking the compatibility with
40 * @defgroup oSIP_LIST oSIP list Handling
52 * Structure for referencing a node in a osip_list_t element.
55 typedef struct __node __node_t;
59 void *next; /* next __node_t */
65 * Structure for referencing a list of elements.
68 typedef struct osip_list osip_list_t;
79 * Initialise a osip_list_t element.
80 * NOTE: this element MUST be previously allocated.
81 * @param li The element to initialise.
83 int osip_list_init (osip_list_t * li);
85 * Free a list of element.
86 * Each element will be free with the method given as the second parameter.
87 * @param li The element to work on.
88 * @param free_func The method that is able to release one element of the list.
90 void osip_list_special_free (osip_list_t * li, void *(*free_func) (void *));
92 * Free a list of element where elements are pointer to 'char'.
93 * @param li The element to work on.
95 void osip_list_ofchar_free (osip_list_t * li);
97 * Get the size of a list of element.
98 * @param li The element to work on.
100 int osip_list_size (const osip_list_t * li);
102 * Check if the end of list is detected .
103 * @param li The element to work on.
104 * @param pos The index of the possible element.
106 int osip_list_eol (const osip_list_t * li, int pos);
108 * Add an element in a list.
109 * @param li The element to work on.
110 * @param element The pointer on the element to add.
111 * @param pos the index of the element to add. (or -1 to append the element at the end)
113 int osip_list_add (osip_list_t * li, void *element, int pos);
115 * Get an element from a list.
116 * @param li The element to work on.
117 * @param pos the index of the element to get.
119 void *osip_list_get (const osip_list_t * li, int pos);
121 * Remove an element from a list.
122 * @param li The element to work on.
123 * @param pos the index of the element to remove.
125 int osip_list_remove (osip_list_t * li, int pos);