1 /*
2   The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3   Copyright (C) 2001-2020 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 #ifndef _OSIP_ACCEPT_H_
21 #define _OSIP_ACCEPT_H_
22 
23 #include <osipparser2/headers/osip_content_type.h>
24 
25 /**
26  * @file osip_accept.h
27  * @brief oSIP osip_accept header definition.
28  */
29 
30 /**
31  * @defgroup oSIP_ACCEPT oSIP accept header definition.
32  * @ingroup oSIP_HEADERS
33  * @{
34  */
35 
36 /**
37  * Structure for accept headers.
38  * @var osip_accept_t
39  */
40 typedef osip_content_type_t osip_accept_t;
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /**
47  * Allocate an Accept element.
48  * @param header The element to work on.
49  */
50 #define accept_init(header) osip_content_type_init(header)
51 /**
52  * Free an Accept element.
53  * @param header The element to work on.
54  */
55 #define osip_accept_free osip_content_type_free
56 /**
57  * Parse an Accept element.
58  * @param header The element to work on.
59  * @param hvalue The string to parse.
60  */
61 #define osip_accept_parse(header, hvalue) osip_content_type_parse(header, hvalue)
62 /**
63  * Get a string representation of an Accept element.
64  * @param header The element to work on.
65  * @param dest A pointer on the new allocated string.
66  */
67 int osip_accept_to_str(const osip_accept_t *header, char **dest);
68 /**
69  * Clone an Accept element.
70  * @param header The element to work on.
71  * @param dest A pointer on the copy of the element.
72  */
73 #define osip_accept_clone osip_content_type_clone
74 /**
75  * Allocate and add a header parameter in an Accept element.
76  * @param header The element to work on.
77  * @param name The token name.
78  * @param value The token value.
79  */
80 #define osip_accept_param_add(header, name, value) osip_generic_param_add((&(header)->gen_params), name, value)
81 /**
82  * Find a header parameter in an Accept element.
83  * @param header The element to work on.
84  * @param name The token name to search.
85  * @param dest A pointer on the element found.
86  */
87 #define osip_accept_param_get_byname(header, name, dest) osip_generic_param_get_byname((&(header)->gen_params), name, dest)
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 /** @} */
94 
95 #endif
96