2 The oSIP library implements the Session Initiation Protocol (SIP -rfc2543-)
3 Copyright (C) 2001 Aymeric MOIZARD jack@atosc.org
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.
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.
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
21 #ifndef _OSIP_CONTENT_TYPE_H_
22 #define _OSIP_CONTENT_TYPE_H_
24 #include <osipparser2/osip_list.h>
27 * @file osip_content_type.h
28 * @brief oSIP osip_content_type header definition.
32 * @defgroup oSIP_CONTENT_TYPE oSIP content-type header definition.
33 * @ingroup oSIP_HEADERS
38 * Structure for Content-Type headers.
39 * @defvar osip_content_type_t
41 typedef struct osip_content_type osip_content_type_t;
43 struct osip_content_type
47 osip_list_t *gen_params;
56 * Allocate a Content-Type element.
57 * @param header The element to work on.
59 int osip_content_type_init (osip_content_type_t ** header);
61 * Free a Content-Type element.
62 * @param header The element to work on.
64 void osip_content_type_free (osip_content_type_t * header);
66 * Parse a Content-Type element.
67 * @param header The element to work on.
68 * @param hvalue The string to parse.
70 int osip_content_type_parse (osip_content_type_t * header, const char *hvalue);
72 * Get a string representation of a Content-Type element.
73 * @param header The element to work on.
74 * @param dest A pointer on the new allocated string.
76 int osip_content_type_to_str (const osip_content_type_t * header, char **dest);
78 * Clone a Content-Type element.
79 * @param header The element to work on.
80 * @param dest A pointer on the copy of the element.
82 int osip_content_type_clone (const osip_content_type_t * header,
83 osip_content_type_t ** dest);
86 * Allocate and add a generic parameter element in a list.
87 * @param header The element to work on.
88 * @param name The token name.
89 * @param value The token value.
91 #define osip_content_type_param_add(header,name,value) osip_generic_param_add((header)->gen_params,name,value)
93 * Find a header parameter in a Content-Type element.
94 * @param header The element to work on.
95 * @param name The token name to search.
96 * @param dest A pointer on the element found.
98 #define osip_content_type_param_get_byname(header,name,dest) osip_generic_param_get_byname((header)->gen_params,name,dest)