and added files
[bcm963xx.git] / userapps / opensource / libosip2 / include / osipparser2 / headers / osip_contact.h
1 /*
2   The oSIP library implements the Session Initiation Protocol (SIP -rfc2543-)
3   Copyright (C) 2001  Aymeric MOIZARD jack@atosc.org
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_CONTACT_H_
22 #define _OSIP_CONTACT_H_
23
24 #include <osipparser2/headers/osip_from.h>
25
26 /**
27  * @file osip_contact.h
28  * @brief oSIP osip_contact header definition.
29  */
30
31 /**
32  * @defgroup oSIP_CONTACT oSIP contact header definition.
33  * @ingroup oSIP_HEADERS
34  * @{
35  */
36
37 /**
38  * Structure for Contact headers.
39  * @defvar osip_contact_t
40  */
41   typedef osip_from_t osip_contact_t;
42
43 #ifdef __cplusplus
44 extern "C"
45 {
46 #endif
47
48 /**
49  * Allocate a Contact element.
50  * @param header The element to work on.
51  */
52   int osip_contact_init (osip_contact_t ** header);
53 /**
54  * Free a Contact element.
55  * @param header The element to work on.
56  */
57   void osip_contact_free (osip_contact_t * header);
58 /**
59  * Parse a Contact element.
60  * @param header The element to work on.
61  * @param hvalue The string to parse.
62  */
63   int osip_contact_parse (osip_contact_t * header, const char *hvalue);
64 /**
65  * Get a string representation of a Contact element.
66  * @param header The element to work on.
67  * @param dest A pointer on the new allocated string.
68  */
69   int osip_contact_to_str (const osip_contact_t * header, char **dest);
70 /**
71  * Clone a Contact element.
72  * @param header The element to work on.
73  * @param dest A pointer on the copy of the element.
74  */
75   int osip_contact_clone (const osip_contact_t * header, osip_contact_t ** dest);
76 /**
77  * Get the displayname from a Contact header.
78  * @param header The element to work on.
79  */
80 #define osip_contact_get_displayname(header) osip_from_get_displayname((osip_from_t*)header)
81 /**
82  * Set the displayname in the Contact element.
83  * @param header The element to work on.
84  * @param value The value of the element.
85  */
86 #define osip_contact_set_displayname(header,value) osip_from_set_displayname((osip_from_t*)header, value)
87 /**
88  * Get the url from a Contact header.
89  * @param header The element to work on.
90  */
91 #define osip_contact_get_url(header)         osip_from_get_url((osip_from_t*)header)
92 /**
93  * Set the url in the Contact element.
94  * @param header The element to work on.
95  * @param url The value of the element.
96  */
97 #define osip_contact_set_url(header,url)       osip_from_set_url((osip_from_t*)header,url)
98 /**
99  * Get a header parameter from a Contact element.
100  * @param header The element to work on.
101  * @param pos The index of the element to get.
102  * @param dest A pointer on the element found.
103  */
104 #define osip_contact_param_get(header,pos,dest) osip_from_param_get((osip_from_t*)header,pos,dest)
105 /**
106  * Allocate and add a generic parameter element in a list.
107  * @param header The element to work on.
108  * @param name The token name.
109  * @param value The token value.
110  */
111 #define osip_contact_param_add(header,name, value) osip_generic_param_add((header)->gen_params, name,value)
112 /**
113  * Find a header parameter in a Contact element.
114  * @param header The element to work on.
115  * @param name The token name to search.
116  * @param dest A pointer on the element found.
117  */
118 #define osip_contact_param_get_byname(header,name,dest) osip_generic_param_get_byname((header)->gen_params,name,dest)
119
120
121 #ifdef __cplusplus
122 }
123 #endif
124
125 /** @} */
126
127 #endif