initial load of upstream version 1.06.32
[xmlrpc-c] / include / xmlrpc-c / client_global.h
1 #ifndef CLIENT_GLOBAL_H_INCLUDED
2 #define CLIENT_GLOBAL_H_INCLUDED
3
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.
10 */
11
12 #define XMLRPC_CLIENT_NO_FLAGS         (0)
13 #define XMLRPC_CLIENT_SKIP_LIBWWW_INIT (1)
14
15 extern void
16 xmlrpc_client_init(int          const flags,
17                    const char * const appname,
18                    const char * const appversion);
19
20 void 
21 xmlrpc_client_init2(xmlrpc_env *                      const env,
22                     int                               const flags,
23                     const char *                      const appname,
24                     const char *                      const appversion,
25                     const struct xmlrpc_clientparms * const clientparms,
26                     unsigned int                      const parm_size);
27
28 extern void
29 xmlrpc_client_cleanup(void);
30
31 /*=========================================================================
32 **  xmlrpc_client_call
33 **=========================================================================
34 **  A synchronous XML-RPC client. Do not attempt to call any of these
35 **  functions from inside an asynchronous callback!
36 */
37
38 xmlrpc_value * 
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,
43                    ...);
44
45 xmlrpc_value * 
46 xmlrpc_client_call_params(xmlrpc_env *   const envP,
47                           const char *   const serverUrl,
48                           const char *   const methodName,
49                           xmlrpc_value * const paramArrayP);
50
51 xmlrpc_value * 
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, 
56                           ...);
57
58 xmlrpc_value *
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);
64
65 void
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);
72
73
74 /*=========================================================================
75 **  xmlrpc_client_call_asynch
76 **=========================================================================
77 **  An asynchronous XML-RPC client.
78 */
79
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. */
86 void 
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,
92                           ...);
93
94 /* As above, but use an xmlrpc_server_info object. The server object can be
95 ** safely destroyed as soon as this function returns. */
96 void 
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,
102                                  ...);
103
104 /* As above, but the parameter list is supplied as an xmlrpc_value
105 ** containing an array.
106 */
107 void
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);
113     
114 /* As above, but use an xmlrpc_server_info object. The server object can be
115 ** safely destroyed as soon as this function returns. */
116 void 
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);
123     
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.
129 */
130
131 /* Finish all outstanding asynchronous calls. Alternatively, the loop
132 ** will exit if someone calls xmlrpc_client_event_loop_end. */
133 extern void
134 xmlrpc_client_event_loop_finish_asynch(void);
135
136
137 /* Finish all outstanding asynchronous calls. */
138 extern void
139 xmlrpc_client_event_loop_finish_asynch_timeout(unsigned long milliseconds);
140
141 #endif