1 #ifndef CLIENT_GLOBAL_H_INCLUDED
2 #define CLIENT_GLOBAL_H_INCLUDED
4 /*=========================================================================
5 ** Initialization and Shutdown
6 **=========================================================================
7 ** These routines initialize and terminate the XML-RPC client. If you're
8 ** already using libwww on your own, you can pass
9 ** XMLRPC_CLIENT_SKIP_LIBWWW_INIT to avoid initializing it twice.
12 #define XMLRPC_CLIENT_NO_FLAGS (0)
13 #define XMLRPC_CLIENT_SKIP_LIBWWW_INIT (1)
16 xmlrpc_client_init(int const flags,
17 const char * const appname,
18 const char * const appversion);
21 xmlrpc_client_init2(xmlrpc_env * const env,
23 const char * const appname,
24 const char * const appversion,
25 const struct xmlrpc_clientparms * const clientparms,
26 unsigned int const parm_size);
29 xmlrpc_client_cleanup(void);
31 /*=========================================================================
33 **=========================================================================
34 ** A synchronous XML-RPC client. Do not attempt to call any of these
35 ** functions from inside an asynchronous callback!
39 xmlrpc_client_call(xmlrpc_env * const envP,
40 const char * const server_url,
41 const char * const method_name,
42 const char * const format,
46 xmlrpc_client_call_params(xmlrpc_env * const envP,
47 const char * const serverUrl,
48 const char * const methodName,
49 xmlrpc_value * const paramArrayP);
52 xmlrpc_client_call_server(xmlrpc_env * const envP,
53 const xmlrpc_server_info * const server,
54 const char * const method_name,
55 const char * const format,
59 xmlrpc_client_call_server_params(
60 xmlrpc_env * const envP,
61 const xmlrpc_server_info * const serverP,
62 const char * const method_name,
63 xmlrpc_value * const paramArrayP);
66 xmlrpc_client_transport_call(
67 xmlrpc_env * const envP,
68 void * const reserved, /* for client handle */
69 const xmlrpc_server_info * const serverP,
70 xmlrpc_mem_block * const callXmlP,
71 xmlrpc_mem_block ** const respXmlPP);
74 /*=========================================================================
75 ** xmlrpc_client_call_asynch
76 **=========================================================================
77 ** An asynchronous XML-RPC client.
80 /* Make an asynchronous XML-RPC call. We make internal copies of all
81 ** arguments except user_data, so you can deallocate them safely as soon
82 ** as you return. Errors will be passed to the callback. You will need
83 ** to run the event loop somehow; see below.
84 ** WARNING: If an error occurs while building the argument, the
85 ** response handler will be called with a NULL param_array. */
87 xmlrpc_client_call_asynch(const char * const server_url,
88 const char * const method_name,
89 xmlrpc_response_handler callback,
90 void * const user_data,
91 const char * const format,
94 /* As above, but use an xmlrpc_server_info object. The server object can be
95 ** safely destroyed as soon as this function returns. */
97 xmlrpc_client_call_server_asynch(xmlrpc_server_info * const server,
98 const char * const method_name,
99 xmlrpc_response_handler callback,
100 void * const user_data,
101 const char * const format,
104 /* As above, but the parameter list is supplied as an xmlrpc_value
105 ** containing an array.
108 xmlrpc_client_call_asynch_params(const char * const server_url,
109 const char * const method_name,
110 xmlrpc_response_handler callback,
111 void * const user_data,
112 xmlrpc_value * const paramArrayP);
114 /* As above, but use an xmlrpc_server_info object. The server object can be
115 ** safely destroyed as soon as this function returns. */
117 xmlrpc_client_call_server_asynch_params(
118 xmlrpc_server_info * const server,
119 const char * const method_name,
120 xmlrpc_response_handler callback,
121 void * const user_data,
122 xmlrpc_value * const paramArrayP);
124 /*=========================================================================
125 ** Event Loop Interface
126 **=========================================================================
127 ** These functions can be used to run the XML-RPC event loop. If you
128 ** don't like these, you can also run the libwww event loop directly.
131 /* Finish all outstanding asynchronous calls. Alternatively, the loop
132 ** will exit if someone calls xmlrpc_client_event_loop_end. */
134 xmlrpc_client_event_loop_finish_asynch(void);
137 /* Finish all outstanding asynchronous calls. */
139 xmlrpc_client_event_loop_finish_asynch_timeout(unsigned long milliseconds);