libxr — developer's documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

xr-call.h
Go to the documentation of this file.
1 /*
2 * Copyright 2006-2008 Ondrej Jirman <ondrej.jirman@zonio.net>
3 *
4 * This file is part of libxr.
5 *
6 * Libxr is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU Lesser General Public License as published by the Free
8 * Software Foundation, either version 2 of the License, or (at your option) any
9 * later version.
10 *
11 * Libxr is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 * details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with libxr. If not, see <http://www.gnu.org/licenses/>.
18 */
19
31 #ifndef __XR_CALL_H__
32 #define __XR_CALL_H__
33
34 #include "xr-value.h"
35
38 typedef enum {
39 XR_CALL_XML_RPC = 0,
40 #ifdef XR_JSON_ENABLED
41 XR_CALL_JSON_RPC,
42 #endif
43 XR_CALL_TRANSPORT_COUNT /* must be last, not a real transport */
44 } xr_call_transport;
45
49 typedef struct _xr_call xr_call;
50
51 G_BEGIN_DECLS
52
59 xr_call* xr_call_new(const char* method);
60
65 void xr_call_free(xr_call* call);
66
72 void xr_call_set_transport(xr_call* call, xr_call_transport transport);
73
82 const char* xr_call_get_method(xr_call* call);
83
92 const char* xr_call_get_method_full(xr_call* call);
93
101 char* xr_call_get_servlet_name(xr_call* call, const char* fallback);
102
109 void xr_call_add_param(xr_call* call, xr_value* val);
110
120 xr_value* xr_call_get_param(xr_call* call, unsigned int pos);
121
128 void xr_call_set_retval(xr_call* call, xr_value* val);
129
138 xr_value* xr_call_get_retval(xr_call* call);
139
147 void xr_call_set_error(xr_call* call, int code, const char* msg, ...);
148
153 gboolean xr_call_error_set(xr_call* call);
154
161 int xr_call_get_error_code(xr_call* call);
162
169 const char* xr_call_get_error_message(xr_call* call);
170
178 void xr_call_serialize_request(xr_call* call, char** buf, int* len);
179
187 void xr_call_serialize_response(xr_call* call, char** buf, int* len);
188
198 gboolean xr_call_unserialize_request(xr_call* call, const char* buf, int len);
199
209 gboolean xr_call_unserialize_response(xr_call* call, const char* buf, int len);
210
216 void xr_call_free_buffer(xr_call* call, char* buf);
217
225 char* xr_call_dump_string(xr_call* call, int indent);
226
232 void xr_call_dump(xr_call* call, int indent);
233
234 G_END_DECLS
235
236 #endif
xr_call_get_method_full
const char * xr_call_get_method_full(xr_call *call)
Get method name (as passed in XML-RPC).
xr_call_get_error_code
int xr_call_get_error_code(xr_call *call)
Get error code that is set on the call object.
xr_call_serialize_response
void xr_call_serialize_response(xr_call *call, char **buf, int *len)
Serialize call object into XML-RPC response.
xr_value
struct _xr_value xr_value
Opaque data structure that holds information about particular node.
Definition: xr-value.h:58
xr_call_transport
xr_call_transport
Transport type.
Definition: xr-call.h:38
xr_call_serialize_request
void xr_call_serialize_request(xr_call *call, char **buf, int *len)
Serialize call object into XML-RPC request.
xr_call_free
void xr_call_free(xr_call *call)
Free call object.
xr_call_error_set
gboolean xr_call_error_set(xr_call *call)
Check whether the XML-RPC error structure is set.
xr_call_get_method
const char * xr_call_get_method(xr_call *call)
Get method name (second part if in Servlet.Method format).
xr_call_unserialize_response
gboolean xr_call_unserialize_response(xr_call *call, const char *buf, int len)
Unserialize XML-RPC response into call object.
xr_call_add_param
void xr_call_add_param(xr_call *call, xr_value *val)
Add parameter to the call obejct.
xr_call_free_buffer
void xr_call_free_buffer(xr_call *call, char *buf)
Free buffer allocated by serialize functions.
xr_call_new
G_BEGIN_DECLS xr_call * xr_call_new(const char *method)
Create new call obejct.
xr_call_get_servlet_name
char * xr_call_get_servlet_name(xr_call *call, const char *fallback)
Get servlet name (as passed in XML-RPC).
xr_call_set_error
void xr_call_set_error(xr_call *call, int code, const char *msg,...)
Set retval to be stadard XML-RPC error structure.
xr_call
struct _xr_call xr_call
Opaque data structrure for storing intermediate representation of XML-RPC call.
Definition: xr-call.h:49
xr_call_get_error_message
const char * xr_call_get_error_message(xr_call *call)
Get error message that is set on the call object.
xr_call_set_retval
void xr_call_set_retval(xr_call *call, xr_value *val)
Set return value of the XML-RPC call.
xr-value.h
Intermediate Representation of XML-RPC Values.
xr_call_get_param
xr_value * xr_call_get_param(xr_call *call, unsigned int pos)
Get parameter from specified position (counts from 0).
xr_call_get_retval
xr_value * xr_call_get_retval(xr_call *call)
Get return value of the XML-RPC call.
xr_call_set_transport
void xr_call_set_transport(xr_call *call, xr_call_transport transport)
Set transport type (default is XR_CALL_XML_RPC).
xr_call_unserialize_request
gboolean xr_call_unserialize_request(xr_call *call, const char *buf, int len)
Unserialize XML-RPC request into call object.
xr_call_dump_string
char * xr_call_dump_string(xr_call *call, int indent)
Debugging function that dumps call object to the string.
xr_call_dump
void xr_call_dump(xr_call *call, int indent)
Debugging function that prints call object using g_print().
Documentation for libxr, Fri Apr 15 2016 08:12:18.