Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / libosip2 / include / osipparser2 / headers / osip_header.h
1 /*
2   The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
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_HEADER_H_
22 #define _OSIP_HEADER_H_
23
24 #include <osipparser2/osip_uri.h>
25
26 /**
27  * @file osip_header.h
28  * @brief oSIP osip_header definition.
29  *
30  */
31
32 /**
33  * @defgroup oSIP_HEADER oSIP header definition.
34  * @ingroup oSIP_HEADERS
35  * @{
36  */
37
38 /**
39  * Structure for 'unknown' headers.
40  * NOTE: 'unknown' header' are used in oSIP for all header that are not
41  * defined by oSIP in the osip_message_t structure. This means that all
42  * 'unknown' header has to be handled with the API related to this 
43  * structure.
44  * @defvar osip_header_t
45  */
46   typedef struct osip_header osip_header_t;
47
48   struct osip_header
49   {
50     char *hname;
51     char *hvalue;
52   };
53
54 /**
55  * Structure for generic parameter headers.
56  * Generic parameter are used in a lot of headers. (To, From, Route,
57  * Record-Route...) All those headers use a common API but this is
58  * hidden by MACROs that you can be found in smsg.h.
59  * @defvar osip_cseq_t
60  */
61   typedef osip_uri_param_t osip_generic_param_t;
62
63 #ifdef __cplusplus
64 extern "C"
65 {
66 #endif
67
68 /**
69  * Allocate a header element.
70  * @param header The element to work on.
71  */
72   int osip_header_init (osip_header_t ** header);
73 /**
74  * Free a header element.
75  * @param header The element to work on.
76  */
77   void osip_header_free (osip_header_t * header);
78 /**
79  * Get a string representation of a header element.
80  * @param header The element to work on.
81  * @param dest A pointer on the new allocated buffer.
82  */
83   int osip_header_to_str (const osip_header_t * header, char **dest);
84 /**
85  * Get the token name a header element.
86  * @param header The element to work on.
87  */
88   char *osip_header_get_name (const osip_header_t * header);
89 /**
90  * Set the token name a header element.
91  * @param header The element to work on.
92  * @param pname The token name to set.
93  */
94   void osip_header_set_name (osip_header_t * header, char *pname);
95 /**
96  * Get the token value a header element.
97  * @param header The element to work on.
98  */
99   char *osip_header_get_value (const osip_header_t * header);
100 /**
101  * Set the token value a header element.
102  * @param header The element to work on.
103  * @param pvalue The token value to set.
104  */
105   void osip_header_set_value (osip_header_t * header, char *pvalue);
106 /**
107  * Clone a header element.
108  * @param header The element to work on.
109  * @param dest A pointer on the copy of the element.
110  */
111   int osip_header_clone (const osip_header_t * header, osip_header_t ** dest);
112
113
114 #ifdef __cplusplus
115 }
116 #endif
117
118 /** @} */
119
120 #endif