Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

osip_fifo.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  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 #ifndef _FIFO_H_
00021 #define _FIFO_H_
00022 
00023 #ifdef OSIP_MT
00024 #include <osip2/osip_mt.h>
00025 #endif
00026 #include <osipparser2/osip_list.h>
00027 
00042 #ifdef __cplusplus
00043 extern "C"
00044 {
00045 #endif
00046 
00047 
00048 #ifndef DOXYGEN
00049 
00050 #define MAX_LEN 1000
00051   typedef enum
00052   { ok, plein, vide }
00053   osip_fifo_etat;
00054 
00055 #endif
00056 
00061   typedef struct osip_fifo osip_fifo_t;
00062 
00067   struct osip_fifo
00068   {
00069 #ifdef OSIP_MT
00070     struct osip_mutex *qislocked;  
00071     struct osip_sem *qisempty;     
00072 #endif
00073     osip_list_t *queue;            
00074     int nb_elt;                    
00075     osip_fifo_etat etat;           
00076   };
00077 
00083   void osip_fifo_init (osip_fifo_t * ff);
00088   void osip_fifo_free (osip_fifo_t * ff);
00094   int osip_fifo_insert (osip_fifo_t * ff, void *element);
00100   int osip_fifo_add (osip_fifo_t * ff, void *element);
00105   int osip_fifo_size (osip_fifo_t * ff);
00106 #ifdef OSIP_MT
00107 
00111   void *osip_fifo_get (osip_fifo_t * ff);
00112 #endif
00113 
00117   void *osip_fifo_tryget (osip_fifo_t * ff);
00118 
00119 
00123 #ifdef __cplusplus
00124 }
00125 #endif
00126 
00127 
00128 #endif

Generated on Tue Feb 22 00:59:46 2005 for libosip by  doxygen 1.4.1