xmlrpc.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. /*
  2. This file is part of libXMLRPC - a C library for xml-encoded function calls.
  3. Author: Dan Libby (dan@libby.com)
  4. Epinions.com may be contacted at feedback@epinions-inc.com
  5. */
  6. /*
  7. Copyright 2000 Epinions, Inc.
  8. Subject to the following 3 conditions, Epinions, Inc. permits you, free
  9. of charge, to (a) use, copy, distribute, modify, perform and display this
  10. software and associated documentation files (the "Software"), and (b)
  11. permit others to whom the Software is furnished to do so as well.
  12. 1) The above copyright notice and this permission notice shall be included
  13. without modification in all copies or substantial portions of the
  14. Software.
  15. 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF
  16. ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY
  17. IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR
  18. PURPOSE OR NONINFRINGEMENT.
  19. 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
  20. SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT
  21. OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING
  22. NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH
  23. DAMAGES.
  24. */
  25. #ifndef XMLRPC_ALREADY_INCLUDED
  26. #define XMLRPC_ALREADY_INCLUDED 1
  27. /* includes */
  28. #include "xml_element.h"
  29. #include <time.h> /* for time_t */
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /* allow version to be specified via compile line define */
  34. #ifndef XMLRPC_LIB_VERSION
  35. #define XMLRPC_LIB_VERSION "0.51"
  36. #endif
  37. /* this number, representing the date, must be increased each time the API changes */
  38. #define XMLRPC_API_NO 20020623
  39. /* this string should be changed with each packaged release */
  40. #define XMLRPC_VERSION_STR "xmlrpc-epi v. " XMLRPC_LIB_VERSION
  41. /* where to find more info. shouldn't need to change much */
  42. #define XMLRPC_HOME_PAGE_STR "http://xmlprc-epi.sourceforge.net/"
  43. /****d* VALUE/XMLRPC_VALUE_TYPE
  44. * NAME
  45. * XMLRPC_VALUE_TYPE
  46. * NOTES
  47. * Defines data types for XMLRPC_VALUE
  48. * Deprecated for public use. See XMLRPC_VALUE_TYPE_EASY
  49. * SEE ALSO
  50. * XMLRPC_VECTOR_TYPE
  51. * XMLRPC_REQUEST_TYPE
  52. * SOURCE
  53. */
  54. typedef enum _XMLRPC_VALUE_TYPE {
  55. xmlrpc_none, /* not a value */
  56. xmlrpc_empty, /* empty value, eg NULL */
  57. xmlrpc_base64, /* base64 value, eg binary data */
  58. xmlrpc_boolean, /* boolean [0 | 1] */
  59. xmlrpc_datetime, /* datetime [ISO8601 | time_t] */
  60. xmlrpc_double, /* double / floating point */
  61. xmlrpc_int, /* integer */
  62. xmlrpc_string, /* string */
  63. xmlrpc_vector /* vector, aka list, array */
  64. } XMLRPC_VALUE_TYPE;
  65. /*******/
  66. /****d* VALUE/XMLRPC_VECTOR_TYPE
  67. * NAME
  68. * XMLRPC_VECTOR_TYPE
  69. * NOTES
  70. * Defines data types for XMLRPC_VECTOR.
  71. * Deprecated for public use. See XMLRPC_VALUE_TYPE_EASY
  72. * SEE ALSO
  73. * XMLRPC_VALUE_TYPE
  74. * XMLRPC_REQUEST_TYPE
  75. * SOURCE
  76. */
  77. typedef enum _XMLRPC_VECTOR_TYPE {
  78. xmlrpc_vector_none, /* not an array */
  79. xmlrpc_vector_array, /* no values may have key names */
  80. xmlrpc_vector_mixed, /* some values may have key names */
  81. xmlrpc_vector_struct /* all values must have key names */
  82. } XMLRPC_VECTOR_TYPE;
  83. /*******/
  84. /****d* VALUE/XMLRPC_VALUE_TYPE_EASY
  85. * NAME
  86. * XMLRPC_VALUE_TYPE_EASY
  87. * NOTES
  88. * Defines data types for XMLRPC_VALUE, including vector types.
  89. * SEE ALSO
  90. * XMLRPC_VECTOR_TYPE
  91. * XMLRPC_REQUEST_TYPE
  92. * SOURCE
  93. */
  94. typedef enum _XMLRPC_VALUE_TYPE_EASY {
  95. xmlrpc_type_none, /* not a value */
  96. xmlrpc_type_empty, /* empty value, eg NULL */
  97. xmlrpc_type_base64, /* base64 value, eg binary data */
  98. xmlrpc_type_boolean, /* boolean [0 | 1] */
  99. xmlrpc_type_datetime, /* datetime [ISO8601 | time_t] */
  100. xmlrpc_type_double, /* double / floating point */
  101. xmlrpc_type_int, /* integer */
  102. xmlrpc_type_string, /* string */
  103. /* -- IMPORTANT: identical to XMLRPC_VALUE_TYPE to this point. -- */
  104. xmlrpc_type_array, /* vector array */
  105. xmlrpc_type_mixed, /* vector mixed */
  106. xmlrpc_type_struct /* vector struct */
  107. } XMLRPC_VALUE_TYPE_EASY;
  108. /*******/
  109. /****d* VALUE/XMLRPC_REQUEST_TYPE
  110. * NAME
  111. * XMLRPC_REQUEST_TYPE
  112. * NOTES
  113. * Defines data types for XMLRPC_REQUEST
  114. * SEE ALSO
  115. * XMLRPC_VALUE_TYPE
  116. * XMLRPC_VECTOR_TYPE
  117. * SOURCE
  118. */
  119. typedef enum _xmlrpc_request_type {
  120. xmlrpc_request_none, /* not a valid request */
  121. xmlrpc_request_call, /* calling/invoking a method */
  122. xmlrpc_request_response, /* responding to a method call */
  123. } XMLRPC_REQUEST_TYPE;
  124. /*******/
  125. /****d* VALUE/XMLRPC_ERROR_CODE
  126. * NAME
  127. * XMLRPC_ERROR_CODE
  128. * NOTES
  129. * All existing error codes
  130. * SEE ALSO
  131. * XMLRPC_REQUEST_ERROR
  132. * SOURCE
  133. */
  134. typedef enum _xmlrpc_error_code {
  135. xmlrpc_error_none = 0, /* not an error */
  136. xmlrpc_error_parse_xml_syntax = -32700,
  137. xmlrpc_error_parse_unknown_encoding = -32701,
  138. xmlrpc_error_parse_bad_encoding = -32702,
  139. xmlrpc_error_invalid_xmlrpc = -32600,
  140. xmlrpc_error_unknown_method = -32601,
  141. xmlrpc_error_invalid_params = -32602,
  142. xmlrpc_error_internal_server = -32603,
  143. xmlrpc_error_application = -32500,
  144. xmlrpc_error_system = -32400,
  145. xmlrpc_error_transport = -32300
  146. } XMLRPC_ERROR_CODE;
  147. /******/
  148. #define xmlrpc_error_parse_xml_syntax_str "parse error. not well formed."
  149. #define xmlrpc_error_parse_unknown_encoding_str "parse error. unknown encoding"
  150. #define xmlrpc_error_parse_bad_encoding_str "parse error. invalid character for encoding"
  151. #define xmlrpc_error_invalid_xmlrpc_str "server error. xml-rpc not conforming to spec"
  152. #define xmlrpc_error_unknown_method_str "server error. method not found."
  153. #define xmlrpc_error_invalid_params_str "server error. invalid method parameters"
  154. #define xmlrpc_error_internal_server_str "server error. internal xmlrpc library error"
  155. #define xmlrpc_error_application_str "application error."
  156. #define xmlrpc_error_system_str "system error."
  157. #define xmlrpc_error_transport_str "transport error."
  158. /****d* VALUE/XMLRPC_VERSION
  159. * NAME
  160. * XMLRPC_VERSION
  161. * NOTES
  162. * Defines xml vocabulary used for generated xml
  163. * SEE ALSO
  164. * XMLRPC_REQUEST_OUTPUT_OPTIONS
  165. * XMLRPC_REQUEST_To_XML ()
  166. * SOURCE
  167. */
  168. typedef enum _xmlrpc_version {
  169. xmlrpc_version_none = 0, /* not a recognized vocabulary */
  170. xmlrpc_version_1_0 = 1, /* xmlrpc 1.0 standard vocab */
  171. xmlrpc_version_simple = 2, /* alt more readable vocab */
  172. xmlrpc_version_danda = 2, /* same as simple. legacy */
  173. xmlrpc_version_soap_1_1 = 3 /* SOAP. version 1.1 */
  174. } XMLRPC_VERSION;
  175. /******/
  176. /****s* VALUE/XMLRPC_REQUEST_OUTPUT_OPTIONS
  177. * NAME
  178. * XMLRPC_REQUEST_OUTPUT_OPTIONS
  179. * NOTES
  180. * Defines output options for generated xml
  181. * SEE ALSO
  182. * XMLRPC_VERSION
  183. * XML_ELEM_OUTPUT_OPTIONS
  184. * XMLRPC_REQUEST_To_XML ()
  185. * SOURCE
  186. */
  187. typedef struct _xmlrpc_request_output_options {
  188. STRUCT_XML_ELEM_OUTPUT_OPTIONS xml_elem_opts; /* xml_element specific output options */
  189. XMLRPC_VERSION version; /* xml vocabulary to use */
  190. } STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS, *XMLRPC_REQUEST_OUTPUT_OPTIONS;
  191. /******/
  192. /****s* VALUE/XMLRPC_REQUEST_INPUT_OPTIONS
  193. * NAME
  194. * XMLRPC_REQUEST_INPUT_OPTIONS
  195. * NOTES
  196. * Defines options for reading in xml data
  197. * SEE ALSO
  198. * XMLRPC_VERSION
  199. * XML_ELEM_INPUT_OPTIONS
  200. * XMLRPC_REQUEST_From_XML ()
  201. * SOURCE
  202. */
  203. typedef struct _xmlrpc_request_input_options {
  204. STRUCT_XML_ELEM_INPUT_OPTIONS xml_elem_opts; /* xml_element specific output options */
  205. } STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS, *XMLRPC_REQUEST_INPUT_OPTIONS;
  206. /******/
  207. /****s* VALUE/XMLRPC_ERROR
  208. * NAME
  209. * XMLRPC_ERROR
  210. * NOTES
  211. * For the reporting and handling of errors
  212. * SOURCE
  213. */
  214. typedef struct _xmlrpc_error {
  215. XMLRPC_ERROR_CODE code;
  216. STRUCT_XML_ELEM_ERROR xml_elem_error; /* xml_element errors (parser errors) */
  217. } STRUCT_XMLRPC_ERROR, *XMLRPC_ERROR;
  218. /******/
  219. /****d* VALUE/XMLRPC_CASE_COMPARISON
  220. * NAME
  221. * XMLRPC_CASE_COMPARISON
  222. * NOTES
  223. * Defines case comparison options for XMLRPC_VALUE/VECTOR API's
  224. * SEE ALSO
  225. * XMLRPC_CASE
  226. * XMLRPC_VALUE
  227. * SOURCE
  228. */
  229. typedef enum _xmlrpc_case_comparison {
  230. xmlrpc_case_insensitive, /* use case-insensitive compare */
  231. xmlrpc_case_sensitive /* use case-sensitive compare */
  232. } XMLRPC_CASE_COMPARISON;
  233. /******/
  234. /****d* VALUE/XMLRPC_CASE
  235. * NAME
  236. * XMLRPC_CASE
  237. * NOTES
  238. * Defines case behavior when setting IDs in XMLRPC_VALUE API's
  239. * SEE ALSO
  240. * XMLRPC_CASE_COMPARISON
  241. * XMLRPC_VALUE
  242. * SOURCE
  243. */
  244. typedef enum _xmlrpc_case {
  245. xmlrpc_case_exact, /* leave case alone */
  246. xmlrpc_case_lower, /* lower-case id */
  247. xmlrpc_case_upper /* upper-case id */
  248. } XMLRPC_CASE;
  249. /******/
  250. /* if you don't like these defaults, you can set them with XMLRPC_SetDefaultIdCase*() */
  251. #define XMLRPC_DEFAULT_ID_CASE XMLRPC_GetDefaultIdCase()
  252. #define XMLRPC_DEFAULT_ID_CASE_SENSITIVITY XMLRPC_GetDefaultIdCaseComparison()
  253. /* opaque (non-public) types. defined locally in xmlrpc.c */
  254. typedef struct _xmlrpc_request* XMLRPC_REQUEST;
  255. typedef struct _xmlrpc_server* XMLRPC_SERVER;
  256. typedef struct _xmlrpc_value* XMLRPC_VALUE;
  257. /****d* VALUE/XMLRPC_Callback
  258. * NAME
  259. * XMLRPC_Callback
  260. * NOTES
  261. * Function prototype for user defined method handlers (callbacks).
  262. * SEE ALSO
  263. * XMLRPC_ServerRegisterMethod ()
  264. * XMLRPC_ServerCallMethod ()
  265. * XMLRPC_REQUEST
  266. * XMLRPC_VALUE
  267. * SOURCE
  268. */
  269. typedef XMLRPC_VALUE (*XMLRPC_Callback)(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData);
  270. /******/
  271. /* ID Case Defaults */
  272. XMLRPC_CASE XMLRPC_GetDefaultIdCase(void);
  273. XMLRPC_CASE XMLRPC_SetDefaultIdCase(XMLRPC_CASE id_case);
  274. XMLRPC_CASE_COMPARISON XMLRPC_GetDefaultIdCaseComparison(void);
  275. XMLRPC_CASE_COMPARISON XMLRPC_SetDefaultIdCaseComparison(XMLRPC_CASE_COMPARISON id_case);
  276. /* Vector manipulation */
  277. int XMLRPC_VectorSize(XMLRPC_VALUE value);
  278. XMLRPC_VALUE XMLRPC_VectorRewind(XMLRPC_VALUE value);
  279. XMLRPC_VALUE XMLRPC_VectorNext(XMLRPC_VALUE value);
  280. int XMLRPC_SetIsVector(XMLRPC_VALUE value, XMLRPC_VECTOR_TYPE type);
  281. int XMLRPC_AddValueToVector(XMLRPC_VALUE target, XMLRPC_VALUE source);
  282. int XMLRPC_AddValuesToVector(XMLRPC_VALUE target, ...);
  283. int XMLRPC_VectorRemoveValue(XMLRPC_VALUE vector, XMLRPC_VALUE value);
  284. XMLRPC_VALUE XMLRPC_VectorGetValueWithID_Case(XMLRPC_VALUE vector, const char* id, XMLRPC_CASE_COMPARISON id_case);
  285. /* Create values */
  286. XMLRPC_VALUE XMLRPC_CreateValueBoolean(const char* id, int truth);
  287. XMLRPC_VALUE XMLRPC_CreateValueBase64(const char* id, const char* s, int len);
  288. XMLRPC_VALUE XMLRPC_CreateValueDateTime(const char* id, time_t time);
  289. XMLRPC_VALUE XMLRPC_CreateValueDateTime_ISO8601(const char* id, const char *s);
  290. XMLRPC_VALUE XMLRPC_CreateValueDouble(const char* id, double f);
  291. XMLRPC_VALUE XMLRPC_CreateValueInt(const char* id, int i);
  292. XMLRPC_VALUE XMLRPC_CreateValueString(const char* id, const char* s, int len);
  293. XMLRPC_VALUE XMLRPC_CreateValueEmpty(void);
  294. XMLRPC_VALUE XMLRPC_CreateVector(const char* id, XMLRPC_VECTOR_TYPE type);
  295. /* Cleanup values */
  296. void XMLRPC_CleanupValue(XMLRPC_VALUE value);
  297. /* Request error */
  298. XMLRPC_VALUE XMLRPC_RequestSetError (XMLRPC_REQUEST request, XMLRPC_VALUE error);
  299. XMLRPC_VALUE XMLRPC_RequestGetError (XMLRPC_REQUEST request);
  300. /* Copy values */
  301. XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value);
  302. XMLRPC_VALUE XMLRPC_DupValueNew(XMLRPC_VALUE xSource);
  303. /* Set Values */
  304. void XMLRPC_SetValueDateTime(XMLRPC_VALUE value, time_t time);
  305. void XMLRPC_SetValueDateTime_ISO8601(XMLRPC_VALUE value, const char* s);
  306. void XMLRPC_SetValueDouble(XMLRPC_VALUE value, double val);
  307. void XMLRPC_SetValueInt(XMLRPC_VALUE value, int val);
  308. void XMLRPC_SetValueBoolean(XMLRPC_VALUE value, int val);
  309. const char *XMLRPC_SetValueString(XMLRPC_VALUE value, const char* s, int len);
  310. void XMLRPC_SetValueBase64(XMLRPC_VALUE value, const char* s, int len);
  311. const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, XMLRPC_CASE id_case);
  312. #define XMLRPC_SetValueID(value, id, len) XMLRPC_SetValueID_Case(value, id, len, XMLRPC_DEFAULT_ID_CASE)
  313. /* Get Values */
  314. const char* XMLRPC_GetValueString(XMLRPC_VALUE value);
  315. int XMLRPC_GetValueStringLen(XMLRPC_VALUE value);
  316. int XMLRPC_GetValueInt(XMLRPC_VALUE value);
  317. int XMLRPC_GetValueBoolean(XMLRPC_VALUE value);
  318. double XMLRPC_GetValueDouble(XMLRPC_VALUE value);
  319. const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value);
  320. time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value);
  321. const char* XMLRPC_GetValueDateTime_ISO8601(XMLRPC_VALUE value);
  322. const char* XMLRPC_GetValueID(XMLRPC_VALUE value);
  323. /* Type introspection */
  324. XMLRPC_VALUE_TYPE XMLRPC_GetValueType(XMLRPC_VALUE v);
  325. XMLRPC_VALUE_TYPE_EASY XMLRPC_GetValueTypeEasy(XMLRPC_VALUE v);
  326. XMLRPC_VECTOR_TYPE XMLRPC_GetVectorType(XMLRPC_VALUE v);
  327. /* Parsing and Creating XML */
  328. XMLRPC_REQUEST XMLRPC_REQUEST_FromXML(const char* in_buf, int len, XMLRPC_REQUEST_INPUT_OPTIONS in_options);
  329. XMLRPC_VALUE XMLRPC_VALUE_FromXML(const char* in_buf, int len, XMLRPC_REQUEST_INPUT_OPTIONS in_options);
  330. char* XMLRPC_REQUEST_ToXML(XMLRPC_REQUEST request, int *buf_len);
  331. char* XMLRPC_VALUE_ToXML(XMLRPC_VALUE val, int* buf_len);
  332. /* Request manipulation funcs */
  333. const char* XMLRPC_RequestSetMethodName(XMLRPC_REQUEST request, const char* methodName);
  334. const char* XMLRPC_RequestGetMethodName(XMLRPC_REQUEST request);
  335. XMLRPC_REQUEST XMLRPC_RequestNew(void);
  336. void XMLRPC_RequestFree(XMLRPC_REQUEST request, int bFreeIO);
  337. XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestSetOutputOptions(XMLRPC_REQUEST request, XMLRPC_REQUEST_OUTPUT_OPTIONS output);
  338. XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestGetOutputOptions(XMLRPC_REQUEST request);
  339. XMLRPC_VALUE XMLRPC_RequestSetData(XMLRPC_REQUEST request, XMLRPC_VALUE data);
  340. XMLRPC_VALUE XMLRPC_RequestGetData(XMLRPC_REQUEST request);
  341. XMLRPC_REQUEST_TYPE XMLRPC_RequestSetRequestType(XMLRPC_REQUEST request, XMLRPC_REQUEST_TYPE type);
  342. XMLRPC_REQUEST_TYPE XMLRPC_RequestGetRequestType(XMLRPC_REQUEST request);
  343. /* Server Creation/Destruction; Method Registration and Invocation */
  344. XMLRPC_SERVER XMLRPC_ServerCreate(void);
  345. XMLRPC_SERVER XMLRPC_GetGlobalServer(void); /* better to use XMLRPC_ServerCreate if you can */
  346. void XMLRPC_ServerDestroy(XMLRPC_SERVER server);
  347. int XMLRPC_ServerRegisterMethod(XMLRPC_SERVER server, const char *name, XMLRPC_Callback cb);
  348. XMLRPC_Callback XMLRPC_ServerFindMethod(XMLRPC_SERVER server, const char* callName);
  349. XMLRPC_VALUE XMLRPC_ServerCallMethod(XMLRPC_SERVER server, XMLRPC_REQUEST request, void* userData);
  350. #include "xmlrpc_introspection.h"
  351. /* Fault interrogation funcs */
  352. int XMLRPC_ValueIsFault (XMLRPC_VALUE value);
  353. int XMLRPC_ResponseIsFault(XMLRPC_REQUEST response);
  354. int XMLRPC_GetValueFaultCode (XMLRPC_VALUE value);
  355. int XMLRPC_GetResponseFaultCode(XMLRPC_REQUEST response);
  356. const char* XMLRPC_GetValueFaultString (XMLRPC_VALUE value);
  357. const char* XMLRPC_GetResponseFaultString (XMLRPC_REQUEST response);
  358. /* Public Utility funcs */
  359. XMLRPC_VALUE XMLRPC_UtilityCreateFault(int fault_code, const char* fault_string);
  360. void XMLRPC_Free(void* mem);
  361. const char* XMLRPC_GetVersionString(void);
  362. /****d* VALUE/XMLRPC_MACROS
  363. * NAME
  364. * Some Helpful Macros
  365. * NOTES
  366. * Some macros for making life easier. Should be self-explanatory.
  367. * SEE ALSO
  368. * XMLRPC_AddValueToVector ()
  369. * XMLRPC_VectorGetValueWithID_Case ()
  370. * XMLRPC_VALUE
  371. * SOURCE
  372. */
  373. /* Append values to vector */
  374. #define XMLRPC_VectorAppendString(vector, id, s, len) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueString(id, s, len))
  375. #define XMLRPC_VectorAppendBase64(vector, id, s, len) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueBase64(id, s, len))
  376. #define XMLRPC_VectorAppendDateTime(vector, id, time) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueDateTime(id, time))
  377. #define XMLRPC_VectorAppendDateTime_ISO8601(vector, id, s) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueDateTime_ISO8601(id, s))
  378. #define XMLRPC_VectorAppendDouble(vector, id, f) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueDouble(id, f))
  379. #define XMLRPC_VectorAppendInt(vector, id, i) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueInt(id, i))
  380. #define XMLRPC_VectorAppendBoolean(vector, id, i) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueBoolean(id, i))
  381. /* Get named values from vector */
  382. #define XMLRPC_VectorGetValueWithID(vector, id) XMLRPC_VectorGetValueWithID_Case(vector, id, XMLRPC_DEFAULT_ID_CASE_SENSITIVITY)
  383. #define XMLRPC_VectorGetStringWithID(vector, id) XMLRPC_GetValueString(XMLRPC_VectorGetValueWithID(vector, id))
  384. #define XMLRPC_VectorGetBase64WithID(vector, id) XMLRPC_GetValueBase64(XMLRPC_VectorGetValueWithID(vector, id))
  385. #define XMLRPC_VectorGetDateTimeWithID(vector, id) XMLRPC_GetValueDateTime(XMLRPC_VectorGetValueWithID(vector, id))
  386. #define XMLRPC_VectorGetDoubleWithID(vector, id) XMLRPC_GetValueDouble(XMLRPC_VectorGetValueWithID(vector, id))
  387. #define XMLRPC_VectorGetIntWithID(vector, id) XMLRPC_GetValueInt(XMLRPC_VectorGetValueWithID(vector, id))
  388. #define XMLRPC_VectorGetBooleanWithID(vector, id) XMLRPC_GetValueBoolean(XMLRPC_VectorGetValueWithID(vector, id))
  389. /******/
  390. #ifdef __cplusplus
  391. }
  392. #endif
  393. #endif /* not XMLRPC_ALREADY_INCLUDED */