SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
osip_to.h
Go to the documentation of this file.
1 /*
2  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3  Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com
4 
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.
9 
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.
14 
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
18 */
19 
20 
21 #ifndef _OSIP_TO_H_
22 #define _OSIP_TO_H_
23 
25 
42 
43 #ifdef __cplusplus
44 extern "C"
45 {
46 #endif
47 
48 #ifndef MINISIZE
49 
53  int osip_to_init (osip_to_t ** header);
58  void osip_to_free (osip_to_t * header);
64  int osip_to_parse (osip_to_t * header, const char *hvalue);
70  int osip_to_to_str (const osip_to_t * header, char **dest);
76  int osip_to_clone (const osip_to_t * header, osip_to_t ** dest);
83  int osip_to_tag_match (osip_to_t * to1, osip_to_t * to2);
84 #else
85  #define osip_to_init osip_from_init
86  #define osip_to_free osip_from_free
87  #define osip_to_parse osip_from_parse
88  #define osip_to_to_str osip_from_to_str
89  #define osip_to_clone osip_from_clone
90  #define osip_to_tag_match osip_from_tag_match
91 #endif
92 
97 #define osip_to_set_displayname(header,value) osip_from_set_displayname((osip_from_t*)header,value)
98 
102 #define osip_to_get_displayname(header) osip_from_get_displayname((osip_from_t*)header)
103 
108 #define osip_to_set_url(header,url) osip_from_set_url((osip_from_t*)header,url)
109 
113 #define osip_to_get_url(header) osip_from_get_url((osip_from_t*)header)
114 
120 #define osip_to_param_get(header,pos,dest) osip_from_param_get((osip_from_t*)header,pos,dest)
121 
127 #define osip_to_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest)
128 
134 #define osip_to_param_add(header,name,value) osip_generic_param_add((&(header)->gen_params),name,value)
135 
141 #define osip_to_set_tag(header,value) osip_generic_param_add((&(header)->gen_params), osip_strdup("tag"),value)
142 
147 #define osip_to_get_tag(header,dest) osip_generic_param_get_byname((&(header)->gen_params), "tag",dest)
148 
149 #ifndef DOXYGEN /* avoid DOXYGEN warning */
150 /* Compare the username, host and tag part of the two froms */
151 #define osip_to_compare(header1, header2) osip_from_compare((osip_from_t *)header1, (osip_from_t *)header2)
152 #endif
153 
154 #ifdef __cplusplus
155 }
156 #endif
157 
160 #endif
int osip_to_clone(const osip_to_t *header, osip_to_t **dest)
Clone a To element.
int osip_to_init(osip_to_t **header)
Allocate a To element.
void osip_to_free(osip_to_t *header)
Free a To element.
oSIP osip_from header definition.
osip_from_t osip_to_t
Structure for To headers.
Definition: osip_to.h:41
int osip_to_parse(osip_to_t *header, const char *hvalue)
Parse a To element.
int osip_to_tag_match(osip_to_t *to1, osip_to_t *to2)
Check if the tags in the To headers match.
Definition of the From header.
Definition: osip_from.h:48
int osip_to_to_str(const osip_to_t *header, char **dest)
Get a string representation of a To element.