2 The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3 Copyright (C) 2001,2002,2003 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
23 #include <osipparser2/osip_port.h>
24 #include <osipparser2/osip_message.h>
25 #include <osipparser2/osip_parser.h>
28 /* adds the mime_version header to message. */
29 /* INPUT : const char *hvalue | value of header. */
30 /* OUTPUT: osip_message_t *sip | structure to save results. */
31 /* returns -1 on error. */
33 osip_message_set_mime_version (osip_message_t * sip, const char *hvalue)
37 if (hvalue == NULL || hvalue[0] == '\0')
40 if (sip->mime_version != NULL)
42 i = osip_mime_version_init (&(sip->mime_version));
45 sip->message_property = 2;
46 i = osip_mime_version_parse (sip->mime_version, hvalue);
49 osip_mime_version_free (sip->mime_version);
50 sip->mime_version = NULL;
56 /* returns the mime_version header. */
57 /* INPUT : osip_message_t *sip | sip message. */
58 /* returns null on error. */
60 osip_message_get_mime_version (const osip_message_t * sip)
62 return sip->mime_version;