osip_list.h

Go to the documentation of this file.
00001 /*
00002   The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
00003   Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@atosc.org
00004   
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 of the License, or (at your option) any later version.
00009   
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Lesser General Public License for more details.
00014   
00015   You should have received a copy of the GNU Lesser General Public
00016   License along with this library; if not, write to the Free Software
00017   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 
00021 #ifndef _LIST_H_
00022 #define _LIST_H_
00023 
00024 #ifdef ENABLE_MPATROL
00025 #include <mpatrol.h>
00026 #endif
00027 
00044 #ifdef __cplusplus
00045 extern "C"
00046 {
00047 #endif
00048 
00049 #ifndef DOXYGEN
00050 
00054   typedef struct __node __node_t;
00055 
00060   struct __node
00061   {
00062     void *next;                 
00063     void *element;              
00064   };
00065 #endif
00066 
00071   typedef struct osip_list osip_list_t;
00072 
00077   typedef struct
00078   {
00079     __node_t *actual;
00080     __node_t **prev;
00081     osip_list_t *li;
00082     int pos;
00083   } osip_list_iterator_t;
00084 
00089   struct osip_list
00090   {
00091 
00092     int nb_elt;         
00093     __node_t *node;     
00095   };
00096 
00106   int osip_list_init (osip_list_t * li);
00113   void osip_list_special_free (osip_list_t * li, void *(*free_func) (void *));
00121   int osip_list_clone (const osip_list_t * src, osip_list_t * dst, int *(*clone_func) (void *, void *));
00126   void osip_list_ofchar_free (osip_list_t * li);
00131   int osip_list_size (const osip_list_t * li);
00137   int osip_list_eol (const osip_list_t * li, int pos);
00144   int osip_list_add (osip_list_t * li, void *element, int pos);
00150   void *osip_list_get (const osip_list_t * li, int pos);
00156   int osip_list_remove (osip_list_t * li, int pos);
00157 
00162 #define osip_list_iterator_has_elem( it ) ( 0 != (it).actual && (it).pos < (it).li->nb_elt )
00163 
00168 void *osip_list_get_first (osip_list_t * li, osip_list_iterator_t * it);
00173   void *osip_list_get_next (osip_list_iterator_t * it);
00178   void *osip_list_iterator_remove (osip_list_iterator_t * it);
00179 
00180 #ifdef __cplusplus
00181 }
00182 #endif
00183 
00184 
00187 #endif

Generated on Wed Feb 13 01:03:29 2008 for libosip by  doxygen 1.5.4