Commit fd41c3e6 authored by Simon Morlat's avatar Simon Morlat

add automake autoconf stuff, change structure names

parent 10122c8b
INSTALL
aclocal.m4
*~
configure
Makefile.in
Makefile
build-aux
m4
autom4te.cache
*.o
*.lo
*.la
config.log
config.status
.deps
.libs
libtool
depcomp
missing
install-sh
config.guess
config.h.in
config.sub
ltmain.sh
.anjuta
belle-sip.anjuta
config.h
*Lexer.h
*Lexer.c
*Parser.h
*Parser.c
*.tokens
This diff is collapsed.
This diff is collapsed.
SUBDIRS=include src tester
#!/bin/sh
if ! type aclocal-$AM_VERSION 1>/dev/null 2>&1; then
# automake-1.10 (recommended) is not available on Fedora 8
AUTOMAKE=automake
ACLOCAL=aclocal
else
ACLOCAL=aclocal-${AM_VERSION}
AUTOMAKE=automake-${AM_VERSION}
fi
if test -f /opt/local/bin/glibtoolize ; then
# darwin
LIBTOOLIZE=/opt/local/bin/glibtoolize
else
LIBTOOLIZE=libtoolize
fi
if test -d /opt/local/share/aclocal ; then
ACLOCAL_ARGS="-I /opt/local/share/aclocal"
fi
echo "Generating build scripts in belle-sip..."
set -x
$LIBTOOLIZE --copy --force
$ACLOCAL $ACLOCAL_ARGS
autoheader
$AUTOMAKE --force-missing --add-missing --copy
autoconf
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
AC_INIT([belle-sip], [0.0.1], [jehan.monnier@linphone.org])
AC_CONFIG_SRCDIR([src/belle_sip_utils.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
LT_INIT(disable-static win32-dll)
if test -f /etc/debian_version ; then
use_deb=true;
else
use_rpm=true;
fi
CFLAGS="-g -O2"
if test x$GCC = xyes ; then
STRICT_OPTIONS=" -Wall -Werror"
dnl because of antlr3 we must accept a few warnings...
LESS_STRICT_OPTIONS="$STRICT_OPTIONS -Wno-error=unused-function -Wno-error=uninitialized"
fi
AC_SUBST(STRICT_OPTIONS)
AC_SUBST(LESS_STRICT_OPTIONS)
# Checks for libraries.
# Checks for header files.
found_antlr3=no
AC_CHECK_HEADERS([antlr3.h], [found_antlr3=yes])
if test x$found_antlr3 = xno ; then
AC_MSG_ERROR([Could not find antlr3 development files. Please install antlr3 (libantlr3c-dev on debian/ubuntu systems)])
fi
found_cunit=no
AC_CHECK_HEADERS([CUnit/Basic.h], [found_cunit=yes])
if test x$found_cunit = xno ; then
AC_MSG_WARN([Could not find cunit framework, tests are not compiled.])
fi
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AM_CONDITIONAL(BUILD_TESTS,test x$found_cunit = xyes)
AC_CONFIG_FILES(
[
Makefile
include/Makefile
include/belle-sip/Makefile
src/Makefile
tester/Makefile
])
AC_OUTPUT
SUBDIRS=belle-sip
bellesipdir=$(includedir)/belle-sip
bellesip_HEADERS=uri.h list.h
EXTRA_DIST=$(bellesip_HEADERS)
/*
* belle_sip_list.h
*
* Created on: 1 oct. 2010
* Author: jehanmonnier
*/
#ifndef BELLE_SIP_LIST_H_
#define BELLE_SIP_LIST_H_
typedef struct _belle_sip_list belle_sip_list_t;
belle_sip_list_t * belle_sip_list_append(belle_sip_list_t * elem, void * data);
belle_sip_list_t * belle_sip_list_prepend(belle_sip_list_t * elem, void * data);
belle_sip_list_t * belle_sip_list_free(belle_sip_list_t * elem);
belle_sip_list_t * belle_sip_list_concat(belle_sip_list_t * first, belle_sip_list_t * second);
belle_sip_list_t * belle_sip_list_remove(belle_sip_list_t * first, void *data);
int belle_sip_list_size(const belle_sip_list_t * first);
void belle_sip_list_for_each(const belle_sip_list_t * list, void (*func)(void *));
void belle_sip_list_for_each2(const belle_sip_list_t * list, void (*func)(void *, void *), void *user_data);
belle_sip_list_t * belle_sip_list_remove_link(belle_sip_list_t * list, belle_sip_list_t * elem);
belle_sip_list_t * belle_sip_list_find(belle_sip_list_t * list, void *data);
typedef int (*belle_sip_compare_func)(const void *, const void*);
belle_sip_list_t * belle_sip_list_find_custom(belle_sip_list_t * list, belle_sip_compare_func cmp, const void *user_data);
void * belle_sip_list_nth_data(const belle_sip_list_t * list, int index);
int belle_sip_list_position(const belle_sip_list_t * list, belle_sip_list_t * elem);
int belle_sip_list_index(const belle_sip_list_t * list, void *data);
belle_sip_list_t * belle_sip_list_insert_sorted(belle_sip_list_t * list, void *data, belle_sip_compare_func cmp);
belle_sip_list_t * belle_sip_list_insert(belle_sip_list_t * list, belle_sip_list_t * before, void *data);
belle_sip_list_t * belle_sip_list_copy(const belle_sip_list_t * list);
#endif /* BELLE_SIP_LIST_H_ */
......@@ -9,152 +9,152 @@
#define BELLE_SIP_URI_H_
#include "belle_sip_list.h"
#include "belle-sip/list.h"
typedef struct _belle_sip_uri belle_sip_uri;
typedef struct _belle_sip_uri belle_sip_uri_t;
belle_sip_uri* belle_sip_uri_new();
belle_sip_uri_t* belle_sip_uri_new();
void belle_sip_uri_delete(belle_sip_uri* uri);
belle_sip_uri* belle_sip_uri_parse (const char* uri) ;
void belle_sip_uri_delete(belle_sip_uri_t* uri);
belle_sip_uri_t* belle_sip_uri_parse (const char* uri) ;
/**
* Returns the value of the named header, or null if it is not set.
*
*/
const char* belle_sip_uri_get_header(belle_sip_uri* uri,const char* name);
const char* belle_sip_uri_get_header(belle_sip_uri_t* uri,const char* name);
/**
* Returns an Iterator over the const char*names of all headers present in this SipURI.
*
*/
belle_sip_list* belle_sip_uri_get_header_names(belle_sip_uri* uri) ;
belle_sip_list_t* belle_sip_uri_get_header_names(belle_sip_uri_t* uri) ;
/**
* Returns the host part of this SipURI.
*
*/
const char* belle_sip_uri_get_host(belle_sip_uri* uri) ;
const char* belle_sip_uri_get_host(belle_sip_uri_t* uri) ;
/**
* Returns the value of the maddr parameter, or null if this is not set.
*
*/
const char* belle_sip_uri_get_maddr_param(belle_sip_uri* uri) ;
const char* belle_sip_uri_get_maddr_param(belle_sip_uri_t* uri) ;
/**
* Returns the value of the method parameter, or null if this is not set.
*
*/
const char* belle_sip_uri_get_method_param(belle_sip_uri* uri) ;
const char* belle_sip_uri_get_method_param(belle_sip_uri_t* uri) ;
/**
* Returns the port part of this SipURI.
*
*/
unsigned int belle_sip_uri_get_port(belle_sip_uri* uri) ;
unsigned int belle_sip_uri_get_port(belle_sip_uri_t* uri) ;
/**
* Returns the value of the "transport" parameter, or null if this is not set.
*
*/
const char* belle_sip_uri_get_transport_param(belle_sip_uri* uri) ;
const char* belle_sip_uri_get_transport_param(belle_sip_uri_t* uri) ;
/**
* Returns the value of the "ttl" parameter, or -1 if this is not set.
*
*/
int belle_sip_uri_get_ttl_param(belle_sip_uri* uri) ;
int belle_sip_uri_get_ttl_param(belle_sip_uri_t* uri) ;
/**
* Returns the user part of this SipURI.
*
*/
const char* belle_sip_uri_get_user(belle_sip_uri* uri) ;
const char* belle_sip_uri_get_user(belle_sip_uri_t* uri) ;
/**
* Returns the value of the userParam, or null if this is not set.
*
*/
const char* belle_sip_uri_get_user_param(belle_sip_uri* uri) ;
const char* belle_sip_uri_get_user_param(belle_sip_uri_t* uri) ;
/**
* Gets user password of SipURI, or null if it is not set.
*
*/
const char* belle_sip_uri_get_user_password(belle_sip_uri* uri) ;
const char* belle_sip_uri_get_user_password(belle_sip_uri_t* uri) ;
/**
* Returns whether the the lr parameter is set.
*
*/
unsigned int belle_sip_uri_has_lr_param(belle_sip_uri* uri) ;
unsigned int belle_sip_uri_has_lr_param(belle_sip_uri_t* uri) ;
/**
*
* Returns true if this SipURI is secure i.e. if this SipURI represents a sips URI.
*
*/
unsigned int belle_sip_uri_is_secure(belle_sip_uri* uri) ;
unsigned int belle_sip_uri_is_secure(belle_sip_uri_t* uri) ;
/**
* Removes the port part of this SipURI.
*
*/
void belle_sip_uri_remove_port(belle_sip_uri* uri) ;
void belle_sip_uri_remove_port(belle_sip_uri_t* uri) ;
/**
* Sets the value of the specified header fields to be included in a request constructed from the URI.
*
*/
void belle_sip_uri_set_header(belle_sip_uri* uri,const char*name, const char*value) ;
void belle_sip_uri_set_header(belle_sip_uri_t* uri,const char*name, const char*value) ;
/**
* Set the host part of this SipURI to the newly supplied host parameter.
*
*/
void belle_sip_uri_set_host(belle_sip_uri* uri,const char*host) ;
void belle_sip_uri_set_host(belle_sip_uri_t* uri,const char*host) ;
/**
* Sets the value of the lr parameter of this SipURI.
*
*/
void belle_sip_uri_set_lr_param(belle_sip_uri* uri,unsigned int param) ;
void belle_sip_uri_set_lr_param(belle_sip_uri_t* uri,unsigned int param) ;
/**
* Sets the value of the maddr parameter of this SipURI.
*
*/
void belle_sip_uri_set_maddr_param(belle_sip_uri* uri,const char*mAddr) ;
void belle_sip_uri_set_maddr_param(belle_sip_uri_t* uri,const char*mAddr) ;
/**
* Sets the value of the method parameter.
*
*/
void belle_sip_uri_set_method_param(belle_sip_uri* uri,const char*method) ;
void belle_sip_uri_set_method_param(belle_sip_uri_t* uri,const char*method) ;
/**
* Set the port part of this SipURI to the newly supplied port parameter.
*
*/
void belle_sip_uri_set_port(belle_sip_uri* uri,unsigned int port) ;
void belle_sip_uri_set_port(belle_sip_uri_t* uri,unsigned int port) ;
/**
* Sets the scheme of this URI to sip or sips depending on whether the argument is true or false.
*
*/
void belle_sip_uri_set_secure(belle_sip_uri* uri,unsigned int secure) ;
void belle_sip_uri_set_secure(belle_sip_uri_t* uri,unsigned int secure) ;
/**
* Sets the value of the "transport" parameter.
*
*/
void belle_sip_uri_set_transport_param(belle_sip_uri* uri,const char*transport) ;
void belle_sip_uri_set_transport_param(belle_sip_uri_t* uri,const char*transport) ;
/**
* Sets the value of the ttl parameter.
*
*/
void belle_sip_uri_set_ttl_param(belle_sip_uri* uri,int ttl) ;
void belle_sip_uri_set_ttl_param(belle_sip_uri_t* uri,int ttl) ;
/**
* Sets the user of SipURI.
*
*/
void belle_sip_uri_set_user(belle_sip_uri* uri,const char*user) ;
void belle_sip_uri_set_user(belle_sip_uri_t* uri,const char*user) ;
/**
* Sets the value of the user parameter.
*
*/
void belle_sip_uri_set_user_param(belle_sip_uri* uri,const char*userParam) ;
void belle_sip_uri_set_user_param(belle_sip_uri_t* uri,const char*userParam) ;
/**
* Sets the user password associated with the user of SipURI.
*
*/
void belle_sip_uri_set_user_password(belle_sip_uri* uri,const char*userPassword) ;
void belle_sip_uri_set_user_password(belle_sip_uri_t* uri,const char*userPassword) ;
/**
* This method returns the URI as a string.
*
*/
char* belle_sip_uri_to_string(belle_sip_uri* uri) ;
char* belle_sip_uri_to_string(belle_sip_uri_t* uri) ;
#endif /*BELLE_SIP_URI_H_*/
......
/*
* belle_sip_list.h
*
* Created on: 1 oct. 2010
* Author: jehanmonnier
*/
#ifndef BELLE_SIP_LIST_H_
#define BELLE_SIP_LIST_H_
typedef struct _belle_sip_list belle_sip_list;
belle_sip_list * belle_sip_list_append(belle_sip_list *elem, void * data);
belle_sip_list * belle_sip_list_prepend(belle_sip_list *elem, void * data);
belle_sip_list * belle_sip_list_free(belle_sip_list *elem);
belle_sip_list * belle_sip_list_concat(belle_sip_list *first, belle_sip_list *second);
belle_sip_list * belle_sip_list_remove(belle_sip_list *first, void *data);
int belle_sip_list_size(const belle_sip_list *first);
void belle_sip_list_for_each(const belle_sip_list *list, void (*func)(void *));
void belle_sip_list_for_each2(const belle_sip_list *list, void (*func)(void *, void *), void *user_data);
belle_sip_list *belle_sip_list_remove_link(belle_sip_list *list, belle_sip_list *elem);
belle_sip_list *belle_sip_list_find(belle_sip_list *list, void *data);
belle_sip_list *belle_sip_list_find_custom(belle_sip_list *list, int (*compare_func)(const void *, const void*), void *user_data);
void * belle_sip_list_nth_data(const belle_sip_list *list, int index);
int belle_sip_list_position(const belle_sip_list *list, belle_sip_list *elem);
int belle_sip_list_index(const belle_sip_list *list, void *data);
belle_sip_list *belle_sip_list_insert_sorted(belle_sip_list *list, void *data, int (*compare_func)(const void *, const void*));
belle_sip_list *belle_sip_list_insert(belle_sip_list *list, belle_sip_list *before, void *data);
belle_sip_list *belle_sip_list_copy(const belle_sip_list *list);
#endif /* BELLE_SIP_LIST_H_ */
ANTLR=antlr3
grammar_files= \
$(srcdir)/belle_sip_uri.g
generated_src= \
belle_sip_uriParser.c belle_sip_uriParser.h \
belle_sip_uriLexer.c belle_sip_uriLexer.h
$(generated_src) : $(grammar_files)
$(ANTLR) -make -fo $(builddir) $(grammar_files)
BUILT_SOURCES=$(generated_src)
noinst_LTLIBRARIES=libbellesip_generated.la
nodist_libbellesip_generated_la_SOURCES=$(generated_src)
libbellesip_generated_la_CFLAGS=$(LESS_STRICT_OPTIONS)
lib_LTLIBRARIES=libbellesip.la
libbellesip_la_SOURCES=belle_sip_uri_impl.c \
belle_sip_utils.c belle_sip_utils.h
libbellesip_la_CFLAGS=$(STRICT_OPTIONS)
libbellesip_la_LIBADD=libbellesip_generated.la -lantlr3c
INCLUDES=-I$(top_srcdir)/include
EXTRA_DIST=$(grammar_files)
CLEANFILES=$(generated_src) *.tokens
......@@ -4,13 +4,13 @@ options {
language = C;
}
@header { #include "belle_sip_uri.h"}
@header { #include "belle-sip/uri.h"}
to_header : 'TO' ':' an_sip_uri;
an_sip_uri returns [belle_sip_uri* ret]
scope { belle_sip_uri* current; }
an_sip_uri returns [belle_sip_uri_t* ret]
scope { belle_sip_uri_t* current; }
@init { $an_sip_uri::current = belle_sip_uri_new(); }
: sip_schema ((userinfo hostport) | hostport ) uri_parameters? headers? {$ret = $an_sip_uri::current;};
sip_schema : ('sip' | is_sips='sips') ':' {if ($is_sips) belle_sip_uri_set_secure($an_sip_uri::current,1);};
......@@ -41,15 +41,15 @@ uri_parameter //all parameters are considered as other
: other_param ;
other_param : pname ( '=' pvalue )?
{
if (strcmp("lr",$pname.text->chars) == 0) {
if (strcmp("lr",(const char *)$pname.text->chars) == 0) {
belle_sip_uri_set_lr_param($an_sip_uri::current,1);
} else if (strcmp("transport",$pname.text->chars)==0) {
} else if (strcmp("transport",(const char*)$pname.text->chars)==0) {
belle_sip_uri_set_transport_param($an_sip_uri::current,(const char *)$pvalue.text->chars);
} else if (strcmp("user",$pname.text->chars)==0) {
} else if (strcmp("user",(const char *)$pname.text->chars)==0) {
belle_sip_uri_set_user_param($an_sip_uri::current,(const char *)$pvalue.text->chars);
} else if (strcmp("maddr",$pname.text->chars)==0) {
} else if (strcmp("maddr",(const char *)$pname.text->chars)==0) {
belle_sip_uri_set_maddr_param($an_sip_uri::current,(const char *)$pvalue.text->chars);
} else if (strcmp("ttl",$pname.text->chars)==0) {
} else if (strcmp("ttl",(const char *)$pname.text->chars)==0) {
belle_sip_uri_set_ttl_param($an_sip_uri::current,atoi((const char *)$pvalue.text->chars));
}
};
......@@ -63,7 +63,7 @@ param_unreserved
: '[' | ']' | '/' | ':' | '&' | '+' | '$' | '.';
headers : '?' header ( '&' header )* ;
header : hname '=' hvalue? {belle_sip_uri_set_header($an_sip_uri::current,$hname.text->chars,$hvalue.text->chars);};
header : hname '=' hvalue? {belle_sip_uri_set_header($an_sip_uri::current,(const char *)$hname.text->chars,(const char *)$hvalue.text->chars);};
hname : ( hnv_unreserved | unreserved | escaped )+;
hvalue : ( hnv_unreserved | unreserved | escaped )+;
......
......@@ -5,7 +5,7 @@
* Author: jehanmonnier
*/
#include "belle_sip_uri.h"
#include "belle-sip/uri.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......@@ -14,10 +14,10 @@
#include "belle_sip_utils.h"
#define GET_SET_STRING(object_type,attribute) \
const char* object_type##_get_##attribute (object_type* obj) {\
const char* object_type##_get_##attribute (object_type##_t* obj) {\
return obj->attribute;\
}\
void object_type##_set_##attribute (object_type* obj,const char* value) {\
void object_type##_set_##attribute (object_type##_t* obj,const char* value) {\
if (obj->attribute != NULL) free((void*)obj->attribute);\
obj->attribute=malloc(strlen(value)+1);\
strcpy((char*)(obj->attribute),value);\
......@@ -26,10 +26,10 @@
#define SIP_URI_GET_SET_STRING(attribute) GET_SET_STRING(belle_sip_uri,attribute)
#define GET_SET_INT(object_type,attribute,type) \
type object_type##_get_##attribute (object_type* obj) {\
type object_type##_get_##attribute (object_type##_t* obj) {\
return obj->attribute;\
}\
void object_type##_set_##attribute (object_type* obj,type value) {\
void object_type##_set_##attribute (object_type##_t* obj,type value) {\
obj->attribute=value;\
}
......@@ -37,10 +37,10 @@
#define SIP_URI_GET_SET_INT(attribute) GET_SET_INT(belle_sip_uri,attribute,int)
#define GET_SET_BOOL(object_type,attribute,getter) \
unsigned int object_type##_##getter##_##attribute (object_type* obj) {\
unsigned int object_type##_##getter##_##attribute (object_type##_t* obj) {\
return obj->attribute;\
}\
void object_type##_set_##attribute (object_type* obj,unsigned int value) {\
void object_type##_set_##attribute (object_type##_t* obj,unsigned int value) {\
obj->attribute=value;\
}
......@@ -53,21 +53,21 @@
struct _belle_sip_uri {
unsigned int secure;
const char* user;
const char* host;
char* user;
char* host;
unsigned int port;
const char* transport_param;
const char* user_param;
const char* method_param;
char* transport_param;
char* user_param;
char* method_param;
unsigned int lr_param;
const char* maddr_param;
char* maddr_param;
int ttl_param;
belle_sip_list* header_list;
belle_sip_list* headernames_list;
belle_sip_list_t* header_list;
belle_sip_list_t* headernames_list;
};
void belle_sip_uri_delete(belle_sip_uri* uri) {
void belle_sip_uri_delete(belle_sip_uri_t* uri) {
if (uri->user) free (uri->user);
if (uri->host) free (uri->host);
......@@ -82,26 +82,28 @@ void belle_sip_uri_delete(belle_sip_uri* uri) {
}
typedef struct _header_pair {
const char* name;
const char* value;
char* name;
char* value;
} header_pair;
static const header_pair* header_pair_new(const char* name,const char* value) {
static header_pair* header_pair_new(const char* name,const char* value) {
header_pair* lPair = (header_pair*)malloc( sizeof(header_pair));
lPair->name=strdup(name);
lPair->value=strdup(value);
return lPair;
}
static void header_pair_delete(header_pair* pair) {
free(pair->name);
free(pair->value);
free (pair);
}
static int header_pair_comp_func(const header_pair *a, const char*b) {
return strcmp(a->name,b);
}
belle_sip_uri* belle_sip_uri_parse (const char* uri) {
belle_sip_uri_t* belle_sip_uri_parse (const char* uri) {
pANTLR3_INPUT_STREAM input;
pbelle_sip_uriLexer lex;
pANTLR3_COMMON_TOKEN_STREAM tokens;
......@@ -114,7 +116,7 @@ belle_sip_uri* belle_sip_uri_parse (const char* uri) {
tokens = antlr3CommonTokenStreamSourceNew (ANTLR3_SIZE_HINT, TOKENSOURCE(lex));
parser = belle_sip_uriParserNew (tokens);
belle_sip_uri* l_parsed_uri = parser->an_sip_uri(parser);
belle_sip_uri_t* l_parsed_uri = parser->an_sip_uri(parser);
// Must manually clean up
//
......@@ -124,16 +126,17 @@ belle_sip_uri* belle_sip_uri_parse (const char* uri) {
input ->close(input);
return l_parsed_uri;
}
belle_sip_uri* belle_sip_uri_new () {
belle_sip_uri* lUri = (belle_sip_uri*)malloc(sizeof(belle_sip_uri));
memset(lUri,0,sizeof(belle_sip_uri));
lUri->ttl_param==-1;
belle_sip_uri_t* belle_sip_uri_new () {
belle_sip_uri_t* lUri = (belle_sip_uri_t*)malloc(sizeof(belle_sip_uri_t));
memset(lUri,0,sizeof(belle_sip_uri_t));
lUri->ttl_param=-1;
return lUri;
}
char* belle_sip_uri_to_string(belle_sip_uri* uri) {
char* belle_sip_uri_to_string(belle_sip_uri_t* uri) {
return belle_sip_concat( "sip:"
,(uri->user?uri->user:"")
,(uri->user?"@":"")
......@@ -144,8 +147,8 @@ char* belle_sip_uri_to_string(belle_sip_uri* uri) {
}
const char* belle_sip_uri_get_header(belle_sip_uri* uri,const char* name) {
belle_sip_list * lResult = belle_sip_list_find_custom(uri->header_list, header_pair_comp_func, name);
const char* belle_sip_uri_get_header(belle_sip_uri_t* uri,const char* name) {
belle_sip_list_t * lResult = belle_sip_list_find_custom(uri->header_list, (belle_sip_compare_func)header_pair_comp_func, name);
if (lResult) {
return ((header_pair*)(lResult->data))->value;
}
......@@ -153,15 +156,15 @@ const char* belle_sip_uri_get_header(belle_sip_uri* uri,const char* name) {
return NULL;
}
}
void belle_sip_uri_set_header(belle_sip_uri* uri,const char* name,const char* value) {
void belle_sip_uri_set_header(belle_sip_uri_t* uri,const char* name,const char* value) {
/*1 check if present*/
belle_sip_list * lResult = belle_sip_list_find_custom(uri->headernames_list, strcmp, name);
belle_sip_list_t * lResult = belle_sip_list_find_custom(uri->headernames_list, (belle_sip_compare_func)strcmp, name);
/* first remove from headersnames list*/
if (lResult) {
belle_sip_list_remove_link(uri->headernames_list,lResult);
}
/* next from header list*/
lResult = belle_sip_list_find_custom(uri->header_list, header_pair_comp_func, name);
lResult = belle_sip_list_find_custom(uri->header_list, (belle_sip_compare_func)header_pair_comp_func, name);
if (lResult) {
header_pair_delete(lResult->data);
belle_sip_list_remove_link(uri->header_list,lResult);
......@@ -172,7 +175,7 @@ void belle_sip_uri_set_header(belle_sip_uri* uri,const char* name,const char* va
uri->headernames_list=belle_sip_list_append(uri->headernames_list,lNewpair->name);
}
belle_sip_list* belle_sip_uri_get_header_names(belle_sip_uri* uri) {
belle_sip_list_t* belle_sip_uri_get_header_names(belle_sip_uri_t* uri) {
return uri->headernames_list;
}
......
......@@ -19,13 +19,13 @@ void belle_sip_set_log_file(FILE *file)
static void __belle_sip_logv_out(belle_sip_log_level lev, const char *fmt, va_list args);
belle_sip_log_function belle_sip_logv_out=__belle_sip_logv_out;
belle_sip_log_function_t belle_sip_logv_out=__belle_sip_logv_out;
/**
*@param func: your logging function, compatible with the OrtpLogFunc prototype.
*
**/
void belle_sip_set_log_handler(belle_sip_log_function func){
void belle_sip_set_log_handler(belle_sip_log_function_t func){
belle_sip_logv_out=func;
}
......@@ -141,17 +141,17 @@ static void __belle_sip_logv_out(belle_sip_log_level lev, const char *fmt, va_li
free(msg);
}
belle_sip_list *belle_sip_list_new(void *data){
belle_sip_list *new_elem=(belle_sip_list *)malloc(sizeof(belle_sip_list));
memset(new_elem,0,sizeof(belle_sip_list));
belle_sip_list_t* belle_sip_list_new(void *data){
belle_sip_list_t* new_elem=(belle_sip_list_t* )malloc(sizeof(belle_sip_list_t));
memset(new_elem,0,sizeof(belle_sip_list_t));
new_elem->prev=new_elem->next=NULL;
new_elem->data=data;
return new_elem;
}
belle_sip_list * belle_sip_list_append(belle_sip_list *elem, void * data){
belle_sip_list *new_elem=belle_sip_list_new(data);
belle_sip_list *it=elem;
belle_sip_list_t* belle_sip_list_append(belle_sip_list_t* elem, void * data){
belle_sip_list_t* new_elem=belle_sip_list_new(data);
belle_sip_list_t* it=elem;
if (elem==NULL) return new_elem;
while (it->next!=NULL) it=belle_sip_list_next(it);
it->next=new_elem;
......@@ -159,8 +159,8 @@ belle_sip_list * belle_sip_list_append(belle_sip_list *elem, void * data){
return elem;
}
belle_sip_list * belle_sip_list_prepend(belle_sip_list *elem, void *data){
belle_sip_list *new_elem=belle_sip_list_new(data);
belle_sip_list_t* belle_sip_list_prepend(belle_sip_list_t* elem, void *data){
belle_sip_list_t* new_elem=belle_sip_list_new(data);
if (elem!=NULL) {
new_elem->next=elem;
elem->prev=new_elem;
......@@ -169,8 +169,8 @@ belle_sip_list * belle_sip_list_prepend(belle_sip_list *elem, void *data){
}
belle_sip_list * belle_sip_list_concat(belle_sip_list *first, belle_sip_list *second){
belle_sip_list *it=first;
belle_sip_list_t* belle_sip_list_concat(belle_sip_list_t* first, belle_sip_list_t* second){
belle_sip_list_t* it=first;
if (it==NULL) return second;
while(it->next!=NULL) it=belle_sip_list_next(it);
it->next=second;
......@@ -178,9 +178,9 @@ belle_sip_list * belle_sip_list_concat(belle_sip_list *first, belle_sip_list *se
return first;
}
belle_sip_list * belle_sip_list_free(belle_sip_list *list){
belle_sip_list *elem = list;
belle_sip_list *tmp;
belle_sip_list_t* belle_sip_list_free(belle_sip_list_t* list){
belle_sip_list_t* elem = list;
belle_sip_list_t* tmp;
if (list==NULL) return NULL;