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
24 #include <osip2/osip_mt.h>
26 #include <osipparser2/osip_list.h>
30 * @brief oSIP fifo Routines
32 * This is a very simple implementation of a fifo.
33 * <BR>There is not much to say about it...
37 * @defgroup oSIP_FIFO oSIP fifo Handling
58 * Structure for referencing a fifo.
61 typedef struct osip_fifo osip_fifo_t;
66 struct osip_mutex *qislocked;
67 struct osip_sem *qisempty;
75 * Initialise a osip_fifo_t element.
76 * NOTE: this element MUST be previously allocated.
77 * @param ff The element to initialise.
79 void osip_fifo_init (osip_fifo_t * ff);
81 * Free a fifo element.
82 * @param ff The element to work on.
84 void osip_fifo_free (osip_fifo_t * ff);
86 * Insert an element in a fifo (at the beginning).
87 * @param ff The element to work on.
88 * @param element The pointer on the element to insert.
90 int osip_fifo_insert (osip_fifo_t * ff, void *element);
92 * Add an element in a fifo.
93 * @param ff The element to work on.
94 * @param element The pointer on the element to add.
96 int osip_fifo_add (osip_fifo_t * ff, void *element);
98 * Get the number of element in a fifo.
99 * @param ff The element to work on.
101 int osip_fifo_size (osip_fifo_t * ff);
104 * Get an element from a fifo or block until one is added.
105 * @param ff The element to work on.
107 void *osip_fifo_get (osip_fifo_t * ff);
110 * Try to get an element from a fifo, but do not block if there is no element.
111 * @param ff The element to work on.
113 void *osip_fifo_tryget (osip_fifo_t * ff);