osip_port.h File Reference

Operation system dependent includes, definitions and functions in oSIP library. More...

#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "osip_const.h"
#include "osip_list.h"

Include dependency graph for osip_port.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define VA_START(a, f)   va_start(a, f)
#define PARAMS(args)   ()
#define SIP_SYNTAX_ERROR   (-1)
#define SIP_NETWORK_ERROR   (-2)
#define SIP_ECONNREFUSED   (-3)
#define SIP_RESSOURCE_ERROR   (-4)
#define SIP_GLOBAL_ERROR   (-5)
#define osip_malloc(S)   (osip_malloc_func?osip_malloc_func(S):malloc(S))
#define osip_realloc(P, S)   (osip_realloc_func?osip_realloc_func(P,S):realloc(P,S))
#define osip_free(P)   { if (P!=NULL) { if (osip_free_func) osip_free_func(P); else free(P);} }
#define SP   " \0"
#define LOG_TRUE   1
#define LOG_FALSE   0
#define OSIP_FATAL   0
#define OSIP_BUG   1
#define OSIP_ERROR   2
#define OSIP_WARNING   3
#define OSIP_INFO1   4
#define OSIP_INFO2   5
#define OSIP_INFO3   6
#define OSIP_INFO4   7
#define TRACE_INITIALIZE(level, file)   do { } while (0)
#define TRACE_ENABLE_LEVEL(level)   do { } while (0)
#define TRACE_DISABLE_LEVEL(level)   do { } while (0)
#define IS_TRACE_LEVEL_ACTIVATE(level)   (-1)
#define OSIP_TRACE(P)   do {} while (0)

Typedefs

typedef void * osip_malloc_func_t (size_t size)
typedef void osip_free_func_t (void *ptr)
typedef void * osip_realloc_func_t (void *ptr, size_t size)
typedef enum _trace_level osip_trace_level_t
typedef void osip_trace_func_t (char *fi, int li, osip_trace_level_t level, char *chfr, va_list ap)

Enumerations

enum  _trace_level {
  TRACE_LEVEL0 = 0, TRACE_LEVEL1 = 1, TRACE_LEVEL2 = 2, TRACE_LEVEL3 = 3,
  TRACE_LEVEL4 = 4, TRACE_LEVEL5 = 5, TRACE_LEVEL6 = 6, TRACE_LEVEL7 = 7,
  END_TRACE_LEVEL = 8
}

Functions

void osip_set_allocators (osip_malloc_func_t *malloc_func, osip_realloc_func_t *realloc_func, osip_free_func_t *free_func)
unsigned int osip_build_random_number (void)
void osip_usleep (int useconds)
int osip_atoi (const char *number)
char * osip_strncpy (char *dest, const char *src, size_t length)
char * osip_strdup (const char *ch)
char * osip_strdup_without_quote (const char *ch)
int osip_tolower (char *word)
int osip_clrspace (char *word)
char * __osip_sdp_append_string (char *string, size_t size, char *cur, char *string_osip_to_append)
int __osip_set_next_token (char **dest, char *buf, int end_separator, char **next)
char * __osip_quote_find (const char *qstring)
char * osip_enquote (const char *s)
void osip_dequote (char *s)
int osip_strcasecmp (const char *s1, const char *s2)
int osip_strncasecmp (const char *s1, const char *s2, size_t len)
unsigned long osip_hash (const char *str)
char * osip_str_append (char *dst, const char *src)
char * osip_strn_append (char *dst, const char *src, size_t len)
char * osip_clrncpy (char *dst, const char *src, size_t len)
void osip_trace_initialize_func (osip_trace_level_t level, osip_trace_func_t *func)
void osip_trace_initialize_syslog (osip_trace_level_t level, char *ident)
void osip_trace_initialize (osip_trace_level_t level, FILE *file)
void osip_trace_enable_until_level (osip_trace_level_t level)
void osip_trace_enable_level (osip_trace_level_t level)
void osip_trace_disable_level (osip_trace_level_t level)
int osip_is_trace_level_activate (osip_trace_level_t level)
int osip_trace (char *fi, int li, osip_trace_level_t level, FILE *f, char *chfr,...)

Variables

osip_malloc_func_tosip_malloc_func
osip_realloc_func_tosip_realloc_func
osip_free_func_tosip_free_func


Detailed Description

Operation system dependent includes, definitions and functions 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_port.h.


Define Documentation

#define IS_TRACE_LEVEL_ACTIVATE ( level   )     (-1)

Definition at line 329 of file osip_port.h.

#define LOG_FALSE   0

Definition at line 285 of file osip_port.h.

Referenced by osip_is_trace_level_activate(), and osip_trace().

#define LOG_TRUE   1

Definition at line 284 of file osip_port.h.

#define OSIP_BUG   1

Referenced by osip_trace().

#define OSIP_ERROR   2

Referenced by osip_trace().

#define OSIP_FATAL   0

Referenced by osip_trace().

#define osip_free (  )     { if (P!=NULL) { if (osip_free_func) osip_free_func(P); else free(P);} }

Definition at line 222 of file osip_port.h.

Referenced by osip_list_iterator_remove(), osip_list_ofchar_free(), osip_list_remove(), osip_list_special_free(), sdp_attribute_free(), sdp_bandwidth_free(), sdp_connection_free(), sdp_key_free(), sdp_media_free(), sdp_message_clone(), sdp_message_free(), sdp_message_m_payload_del(), sdp_message_m_port_set(), sdp_message_to_str(), and sdp_time_descr_free().

#define OSIP_INFO1   4

Referenced by osip_trace().

#define OSIP_INFO2   5

Referenced by osip_trace().

#define OSIP_INFO3   6

Referenced by osip_trace().

#define OSIP_INFO4   7

Referenced by osip_trace(), and sdp_message_parse().

#define osip_malloc (  )     (osip_malloc_func?osip_malloc_func(S):malloc(S))

Definition at line 216 of file osip_port.h.

Referenced by __osip_set_next_token(), osip_enquote(), osip_list_add(), osip_strdup(), osip_strdup_without_quote(), sdp_attribute_init(), sdp_bandwidth_init(), sdp_connection_init(), sdp_key_init(), sdp_media_init(), sdp_message_init(), sdp_message_parse_e(), sdp_message_parse_i(), sdp_message_parse_p(), sdp_message_parse_r(), sdp_message_parse_s(), sdp_message_parse_u(), sdp_message_parse_v(), sdp_message_parse_z(), sdp_message_to_str(), and sdp_time_descr_init().

#define osip_realloc ( P,
 )     (osip_realloc_func?osip_realloc_func(P,S):realloc(P,S))

Definition at line 219 of file osip_port.h.

Referenced by __osip_sdp_append_string().

#define OSIP_TRACE (  )     do {} while (0)

Definition at line 351 of file osip_port.h.

Referenced by sdp_message_parse().

#define OSIP_WARNING   3

Referenced by osip_trace().

#define PARAMS ( args   )     ()

Definition at line 161 of file osip_port.h.

#define SIP_ECONNREFUSED   (-3)

Definition at line 169 of file osip_port.h.

#define SIP_GLOBAL_ERROR   (-5)

Definition at line 171 of file osip_port.h.

#define SIP_NETWORK_ERROR   (-2)

Definition at line 168 of file osip_port.h.

#define SIP_RESSOURCE_ERROR   (-4)

Definition at line 170 of file osip_port.h.

#define SIP_SYNTAX_ERROR   (-1)

Definition at line 167 of file osip_port.h.

#define SP   " \0"

Definition at line 249 of file osip_port.h.

#define TRACE_DISABLE_LEVEL ( level   )     do { } while (0)

Definition at line 328 of file osip_port.h.

#define TRACE_ENABLE_LEVEL ( level   )     do { } while (0)

Definition at line 327 of file osip_port.h.

#define TRACE_INITIALIZE ( level,
file   )     do { } while (0)

Definition at line 326 of file osip_port.h.

#define VA_START ( a,
 )     va_start(a, f)

Definition at line 116 of file osip_port.h.

Referenced by osip_trace().


Typedef Documentation

typedef void osip_free_func_t(void *ptr)

Definition at line 185 of file osip_port.h.

typedef void* osip_malloc_func_t(size_t size)

Definition at line 184 of file osip_port.h.

typedef void* osip_realloc_func_t(void *ptr, size_t size)

Definition at line 186 of file osip_port.h.

typedef void osip_trace_func_t(char *fi, int li, osip_trace_level_t level, char *chfr, va_list ap)

Definition at line 310 of file osip_port.h.

typedef enum _trace_level osip_trace_level_t


Enumeration Type Documentation

enum _trace_level

Enumerator:
TRACE_LEVEL0 
TRACE_LEVEL1 
TRACE_LEVEL2 
TRACE_LEVEL3 
TRACE_LEVEL4 
TRACE_LEVEL5 
TRACE_LEVEL6 
TRACE_LEVEL7 
END_TRACE_LEVEL 

Definition at line 287 of file osip_port.h.


Function Documentation

char* __osip_quote_find ( const char *  qstring  ) 

Definition at line 501 of file osip_port.c.

char* __osip_sdp_append_string ( char *  string,
size_t  size,
char *  cur,
char *  string_osip_to_append 
)

Definition at line 242 of file osip_port.c.

References osip_realloc, and osip_strncpy().

Referenced by sdp_append_attribute(), sdp_append_bandwidth(), sdp_append_connection(), sdp_append_key(), sdp_append_media(), sdp_append_time_descr(), and sdp_message_to_str().

Here is the call graph for this function:

Here is the caller graph for this function:

int __osip_set_next_token ( char **  dest,
char *  buf,
int  end_separator,
char **  next 
)

Definition at line 438 of file osip_port.c.

References osip_malloc, and osip_strncpy().

Referenced by sdp_message_parse_a(), sdp_message_parse_b(), sdp_message_parse_c(), sdp_message_parse_k(), sdp_message_parse_m(), sdp_message_parse_o(), and sdp_message_parse_t().

Here is the call graph for this function:

Here is the caller graph for this function:

int osip_atoi ( const char *  number  ) 

Definition at line 214 of file osip_port.c.

unsigned int osip_build_random_number ( void   ) 

Definition at line 116 of file osip_port.c.

References random_seed_set.

char* osip_clrncpy ( char *  dst,
const char *  src,
size_t  len 
)

Definition at line 1144 of file osip_port.c.

int osip_clrspace ( char *  word  ) 

Definition at line 388 of file osip_port.c.

void osip_dequote ( char *  s  ) 

Definition at line 596 of file osip_port.c.

char* osip_enquote ( const char *  s  ) 

Definition at line 564 of file osip_port.c.

References osip_malloc.

unsigned long osip_hash ( const char *  str  ) 

Definition at line 1090 of file osip_port.c.

int osip_is_trace_level_activate ( osip_trace_level_t  level  ) 

Definition at line 645 of file osip_port.c.

References LOG_FALSE.

void osip_set_allocators ( osip_malloc_func_t malloc_func,
osip_realloc_func_t realloc_func,
osip_free_func_t free_func 
)

Definition at line 917 of file osip_port.c.

References osip_free_func, osip_malloc_func, and osip_realloc_func.

char* osip_str_append ( char *  dst,
const char *  src 
)

Definition at line 1115 of file osip_port.c.

int osip_strcasecmp ( const char *  s1,
const char *  s2 
)

Definition at line 344 of file osip_port.c.

char* osip_strdup ( const char *  ch  ) 

Definition at line 296 of file osip_port.c.

References osip_malloc, and osip_strncpy().

Referenced by sdp_message_parse_o(), and sdp_message_parse_s().

Here is the call graph for this function:

Here is the caller graph for this function:

char* osip_strdup_without_quote ( const char *  ch  ) 

Definition at line 310 of file osip_port.c.

References osip_malloc, and osip_strncpy().

Here is the call graph for this function:

char* osip_strn_append ( char *  dst,
const char *  src,
size_t  len 
)

Definition at line 1130 of file osip_port.c.

int osip_strncasecmp ( const char *  s1,
const char *  s2,
size_t  len 
)

Definition at line 363 of file osip_port.c.

char* osip_strncpy ( char *  dest,
const char *  src,
size_t  length 
)

Definition at line 231 of file osip_port.c.

Referenced by __osip_sdp_append_string(), __osip_set_next_token(), osip_strdup(), osip_strdup_without_quote(), sdp_message_parse_e(), sdp_message_parse_i(), sdp_message_parse_p(), sdp_message_parse_r(), sdp_message_parse_s(), sdp_message_parse_u(), sdp_message_parse_v(), and sdp_message_parse_z().

Here is the caller graph for this function:

int osip_tolower ( char *  word  ) 

Definition at line 325 of file osip_port.c.

int osip_trace ( char *  fi,
int  li,
osip_trace_level_t  level,
FILE *  f,
char *  chfr,
  ... 
)

Definition at line 755 of file osip_port.c.

References LOG_FALSE, logfile, OSIP_BUG, OSIP_ERROR, OSIP_FATAL, OSIP_INFO1, OSIP_INFO2, OSIP_INFO3, OSIP_INFO4, OSIP_WARNING, trace_func, tracing_table, use_syslog, and VA_START.

Referenced by sdp_message_parse().

Here is the caller graph for this function:

void osip_trace_disable_level ( osip_trace_level_t  level  ) 

Definition at line 640 of file osip_port.c.

void osip_trace_enable_level ( osip_trace_level_t  level  ) 

Definition at line 636 of file osip_port.c.

void osip_trace_enable_until_level ( osip_trace_level_t  level  ) 

void osip_trace_initialize ( osip_trace_level_t  level,
FILE *  file 
)

Definition at line 632 of file osip_port.c.

void osip_trace_initialize_func ( osip_trace_level_t  level,
osip_trace_func_t func 
)

Definition at line 624 of file osip_port.c.

void osip_trace_initialize_syslog ( osip_trace_level_t  level,
char *  ident 
)

Definition at line 628 of file osip_port.c.

void osip_usleep ( int  useconds  ) 

Definition at line 260 of file osip_port.c.

References sec().

Here is the call graph for this function:


Variable Documentation

osip_free_func_t* osip_free_func

Definition at line 111 of file osip_port.c.

Referenced by osip_set_allocators().

osip_malloc_func_t* osip_malloc_func

Definition at line 109 of file osip_port.c.

Referenced by osip_set_allocators().

osip_realloc_func_t* osip_realloc_func

Definition at line 110 of file osip_port.c.

Referenced by osip_set_allocators().


Generated on Fri Mar 9 20:04:01 2007 for MAD-FCL by  doxygen 1.5.0