Debian Codegraph @

Xpjproject/pjsip/include/pjsip-simple/xpidf.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program 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
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #ifndef __PJSIP_SIMPLE_XPIDF_H__
20 #define __PJSIP_SIMPLE_XPIDF_H__
21
22 /**
23 * @file xpidf.h
24 * @brief XPIDF/Presence Information Data Format
25 */
26 #include <pjsip-simple/types.h>
27 #include <pjlib-util/xml.h>
28
29 PJ_BEGIN_DECL
30
31 /**
32 * @defgroup PJSIP_SIMPLE_XPIDF XPIDF/Presence Information Data Format
33 * @ingroup PJSIP_SIMPLE
34 * @brief Support for XPIDF/Presence Information Data Format
35 * @{
36 *
37 * This is an old presence data format as described in:
38 * draft-rosenberg-impp-pidf-00.txt.
39 *
40 * We won't support this format extensively here, as it seems there's not
41 * too many implementations support this anymore, as it shouldn't.
42 */
43
44 /** Type definitions for XPIDF root document. */
45 typedef pj_xml_node pjxpidf_pres;
46
47
48 /**
49 * Create a new XPIDF document.
50 *
51 * @param pool Pool.
52 * @param uri URI to set in the XPIDF document.
53 *
54 * @return XPIDF document.
55 */
56 PJ_DECL(pjxpidf_pres*) pjxpidf_create(pj_pool_t *pool, const pj_str_t *uri);
57
58
59 /**
60 * Parse XPIDF document.
61 *
62 * Note that the input text buffer MUST be NULL terminated and have
63 * length at least len+1 (len MUST NOT include the NULL terminator).
64 *
65 * @param pool Pool.
66 * @param text Input text, MUST be NULL terminated.
67 * @param len Length of input text, NOT including the NULL terminator.
68 *
69 * @return XPIDF document.
70 */
71 PJ_DECL(pjxpidf_pres*) pjxpidf_parse(pj_pool_t *pool, char *text, pj_size_t len);
72
73
74 /**
75 * Print XPIDF document.
76 *
77 * @param pres The XPIDF document to print.
78 * @param text Buffer to place the output.
79 * @param len Length of the buffer.
80 *
81 * @return The length printed.
82 */
83 PJ_DECL(int) pjxpidf_print( pjxpidf_pres *pres, char *text, pj_size_t len);
84
85
86 /**
87 * Get URI in the XPIDF document
88 *
89 * @param pres XPIDF document
90 *
91 * @return The URI, or an empty string.
92 */
93 PJ_DECL(pj_str_t*) pjxpidf_get_uri(pjxpidf_pres *pres);
94
95
96 /**
97 * Set the URI of the XPIDF document.
98 *
99 * @param pool Pool.
100 * @param pres The XPIDF document.
101 * @param uri URI to set in the XPIDF document.
102 *
103 * @return Zero on success.
104 */
105 PJ_DECL(pj_status_t) pjxpidf_set_uri(pj_pool_t *pool, pjxpidf_pres *pres,
106 const pj_str_t *uri);
107
108
109 /**
110 * Get presence status in the XPIDF document.
111 *
112 * @param pres XPIDF document.
113 *
114 * @return True to indicate the contact is online.
115 */
116 PJ_DECL(pj_bool_t) pjxpidf_get_status(pjxpidf_pres *pres);
117
118
119 /**
120 * Set presence status in the XPIDF document.
121 *
122 * @param pres XPIDF document.
123 * @param status Status to set, True for online, False for offline.
124 *
125 * @return Zero on success.
126 */
127 PJ_DECL(pj_status_t) pjxpidf_set_status(pjxpidf_pres *pres, pj_bool_t status);
128
129
130 /**
131 * @}
132 */
133
134 PJ_END_DECL
135
136
137 #endif /* __PJSIP_SIMPLE_XPIDF_H__ */