osip_list.c File Reference

Implementation of a linked list in oSIP library. More...

#include <stdlib.h>
#include <stdio.h>
#include "osip_port.h"
#include "osip_list.h"

Include dependency graph for osip_list.c:

Go to the source code of this file.

Functions

int osip_list_init (osip_list_t *li)
void osip_list_special_free (osip_list_t *li, void *(*free_func)(void *))
void osip_list_ofchar_free (osip_list_t *li)
int osip_list_size (const osip_list_t *li)
int osip_list_eol (const osip_list_t *li, int i)
int osip_list_add (osip_list_t *li, void *el, int pos)
void * osip_list_get (const osip_list_t *li, int pos)
void * osip_list_get_first (osip_list_t *li, osip_list_iterator_t *iterator)
void * osip_list_get_next (osip_list_iterator_t *iterator)
void * osip_list_iterator_remove (osip_list_iterator_t *iterator)
int osip_list_remove (osip_list_t *li, int pos)


Detailed Description

Implementation of a linked list in oSIP library.

Author
peltotal
Date
2006/11/07 19:36:20
Revision
1.2

The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) Copyright (C) 2001,2002,2003,2004 Aymeric MOIZARD jack@atosc.org

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 osip_list.c.


Function Documentation

int osip_list_add ( osip_list_t li,
void *  element,
int  pos 
)

Add an element in a list.

Parameters:
li The element to work on.
element The pointer on the element to add.
pos the index of the element to add. (or -1 to append the element at the end)

Definition at line 101 of file osip_list.c.

References __node::element, osip_list::nb_elt, __node::next, osip_list::node, and osip_malloc.

Referenced by sdp_message_a_attribute_add(), sdp_message_b_bandwidth_add(), sdp_message_c_connection_add(), sdp_message_e_email_add(), sdp_message_m_media_add(), sdp_message_m_payload_add(), sdp_message_p_phone_add(), sdp_message_parse_a(), sdp_message_parse_b(), sdp_message_parse_c(), sdp_message_parse_e(), sdp_message_parse_m(), sdp_message_parse_p(), sdp_message_parse_r(), sdp_message_parse_t(), sdp_message_r_repeat_add(), and sdp_message_t_time_descr_add().

Here is the caller graph for this function:

int osip_list_eol ( const osip_list_t li,
int  pos 
)

Check if the end of list is detected .

Parameters:
li The element to work on.
pos The index of the possible element.

Definition at line 90 of file osip_list.c.

Referenced by osip_list_ofchar_free(), osip_list_special_free(), sdp_append_media(), sdp_append_time_descr(), sdp_message_endof_media(), and sdp_message_to_str().

Here is the caller graph for this function:

void* osip_list_get ( const osip_list_t li,
int  pos 
)

Get an element from a list.

Parameters:
li The element to work on.
pos the index of the element to get.

Definition at line 185 of file osip_list.c.

References __node::element, osip_list::nb_elt, __node::next, and osip_list::node.

Referenced by osip_list_ofchar_free(), osip_list_special_free(), sdp_append_media(), sdp_append_time_descr(), sdp_message_a_attribute_add(), sdp_message_a_attribute_del(), sdp_message_a_attribute_del_at_index(), sdp_message_attribute_get(), sdp_message_b_bandwidth_add(), sdp_message_bandwidth_get(), sdp_message_c_connection_add(), sdp_message_connection_get(), sdp_message_e_email_get(), sdp_message_i_info_get(), sdp_message_i_info_set(), sdp_message_k_key_set(), sdp_message_k_keydata_get(), sdp_message_k_keytype_get(), sdp_message_m_media_get(), sdp_message_m_number_of_port_get(), sdp_message_m_payload_add(), sdp_message_m_payload_del(), sdp_message_m_payload_get(), sdp_message_m_port_get(), sdp_message_m_port_set(), sdp_message_m_proto_get(), sdp_message_p_phone_get(), sdp_message_parse_a(), sdp_message_parse_b(), sdp_message_parse_c(), sdp_message_parse_i(), sdp_message_parse_k(), sdp_message_parse_r(), sdp_message_r_repeat_add(), sdp_message_r_repeat_get(), sdp_message_t_start_time_get(), sdp_message_t_stop_time_get(), and sdp_message_to_str().

Here is the caller graph for this function:

void* osip_list_get_first ( osip_list_t li,
osip_list_iterator_t iterator 
)

Definition at line 210 of file osip_list.c.

References osip_list_iterator_t::actual, __node::element, osip_list_iterator_t::li, osip_list::nb_elt, osip_list::node, osip_list_iterator_t::pos, and osip_list_iterator_t::prev.

void* osip_list_get_next ( osip_list_iterator_t iterator  ) 

Definition at line 228 of file osip_list.c.

References osip_list_iterator_t::actual, __node::next, osip_list_iterator_has_elem, osip_list_iterator_t::pos, and osip_list_iterator_t::prev.

int osip_list_init ( osip_list_t li  ) 

Initialise a osip_list_t element. NOTE: this element MUST be previously allocated with osip_malloc(). The osip_free() call on the list is still automatically done by osip_list_free(). This also means you can't use a static osip_list_t variable if you want to use osip_list_free().

Parameters:
li The element to initialise.

Definition at line 30 of file osip_list.c.

Referenced by sdp_media_init(), sdp_message_init(), and sdp_time_descr_init().

Here is the caller graph for this function:

void* osip_list_iterator_remove ( osip_list_iterator_t iterator  ) 

Definition at line 245 of file osip_list.c.

References osip_free, and osip_list_iterator_has_elem.

void osip_list_ofchar_free ( osip_list_t li  ) 

Free a list of element where elements are pointer to 'char'.

Parameters:
li The element to work on.

Definition at line 57 of file osip_list.c.

References osip_free, osip_list_eol(), osip_list_get(), and osip_list_remove().

Referenced by sdp_media_free(), sdp_message_free(), and sdp_time_descr_free().

Here is the call graph for this function:

Here is the caller graph for this function:

int osip_list_remove ( osip_list_t li,
int  pos 
)

Remove an element from a list.

Parameters:
li The element to work on.
pos the index of the element to remove.

Definition at line 267 of file osip_list.c.

References osip_list::nb_elt, __node::next, osip_list::node, and osip_free.

Referenced by osip_list_ofchar_free(), osip_list_special_free(), sdp_message_a_attribute_del(), sdp_message_a_attribute_del_at_index(), and sdp_message_m_payload_del().

Here is the caller graph for this function:

int osip_list_size ( const osip_list_t li  ) 

Get the size of a list of element.

Parameters:
li The element to work on.

Definition at line 74 of file osip_list.c.

References osip_list::nb_elt.

Referenced by sdp_attr_get(), sdp_fec_dec_get(), sdp_message_a_attribute_add(), sdp_message_a_attribute_del(), sdp_message_a_attribute_del_at_index(), sdp_message_b_bandwidth_add(), sdp_message_c_connection_add(), sdp_message_e_email_get(), sdp_message_k_key_set(), sdp_message_k_keydata_get(), sdp_message_k_keytype_get(), sdp_message_p_phone_get(), sdp_message_parse(), sdp_message_parse_a(), sdp_message_parse_b(), sdp_message_parse_c(), sdp_message_parse_i(), sdp_message_parse_k(), and sdp_message_parse_r().

Here is the caller graph for this function:

void osip_list_special_free ( osip_list_t li,
void *(*)(void *)  free_func 
)

Free a list of element. Each element will be free with the method given as the second parameter.

Parameters:
li The element to work on.
free_func The method that is able to release one element of the list.

Definition at line 39 of file osip_list.c.

References osip_free, osip_list_eol(), osip_list_get(), and osip_list_remove().

Referenced by sdp_media_free(), and sdp_message_free().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Fri Mar 9 20:08:58 2007 for MAD-FCL by  doxygen 1.5.0