libosip  4.1.0
osip_body.h
Go to the documentation of this file.
1 /*
2  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3  Copyright (C) 2001-2012 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 
21 #ifndef _OSIP_BODY_H_
22 #define _OSIP_BODY_H_
23 
25 
42 typedef struct osip_body osip_body_t;
43 
48 struct osip_body {
49  char *body;
50  size_t length;
54 };
55 
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
65  int osip_body_init (osip_body_t ** body);
70  void osip_body_free (osip_body_t * body);
77  int osip_body_parse (osip_body_t * body, const char *buf, size_t length);
83  int osip_body_clone (const osip_body_t * body, osip_body_t ** dest);
90  int osip_body_parse_mime (osip_body_t * body, const char *buf, size_t length);
97  int osip_body_to_str (const osip_body_t * body, char **dest, size_t * length);
98 
104  int osip_body_set_contenttype (osip_body_t * body, const char *hvalue);
105 
112  int osip_body_set_header (osip_body_t * body, const char *hname, const char *hvalue);
113 
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 #endif