Debian Codegraph @

modules/transport/xmlrpc/xmlrpclib.h

raw
1 /*
2 * Copyright (c) 2005 Atheme Development Group
3 * and Trystan Scott Lee <[email protected]>
4 *
5 * XMLRPC library header, hacked up for Atheme.
6 *
7 */
8 #ifndef XMLRPC_H
9 #define XMLRPC_H
10
11 #include "atheme.h"
12
13 #define stricmp strcasecmp
14
15 #define XMLRPC_STOP 1
16 #define XMLRPC_CONT 0
17
18 #define XMLRPC_ERR_OK 0
19 #define XMLRPC_ERR_MEMORY 1
20 #define XMLRPC_ERR_PARAMS 2
21 #define XMLRPC_ERR_EXISTS 3
22 #define XMLRPC_ERR_NOEXIST 4
23 #define XMLRPC_ERR_NOUSER 5
24 #define XMLRPC_ERR_NOLOAD 6
25 #define XMLRPC_ERR_NOUNLOAD 7
26 #define XMLRPC_ERR_SYNTAX 8
27 #define XMLRPC_ERR_NODELETE 9
28 #define XMLRPC_ERR_UNKNOWN 10
29 #define XMLRPC_ERR_FILE_IO 11
30 #define XMLRPC_ERR_NOSERVICE 12
31 #define XMLRPC_ERR_NO_MOD_NAME 13
32
33 /*
34 * Header that defines much of the xml/xmlrpc library
35 */
36
37 #define XMLRPC_BUFSIZE 4096
38 #define XMLLIB_VERSION "1.0.0"
39 #define XMLLIB_AUTHOR "Trystan Scott Lee <[email protected]>"
40
41 #define XMLRPCCMD XMLRPCCMD_cmdTable
42 #define CMD_HASH(x) (((x)[0]&31)<<5 | ((x)[1]&31)) /* Will gen a hash from a string :) */
43 #define MAX_CMD_HASH 1024
44
45 #define XMLRPC_ON "on"
46 #define XMLRPC_OFF "off"
47
48 #define XMLRPC_I4 "i4"
49 #define XMLRPC_INT "integer"
50
51 #define XMLRPC_HTTP_HEADER 1
52 #define XMLRPC_ENCODE 2
53 #define XMLRPC_INTTAG 3
54
55 typedef int (*XMLRPCMethodFunc)(void *userdata, int ac, char **av);
56
57 E int xmlrpc_getlast_error(void);
58 E void xmlrpc_process(char *buffer, void *userdata);
59 E int xmlrpc_register_method(const char *name, XMLRPCMethodFunc func);
60 E int xmlrpc_unregister_method(const char *method);
61
62 E char *xmlrpc_array(int argc, ...);
63 E char *xmlrpc_double(char *buf, double value);
64 E char *xmlrpc_boolean(char *buf, int value);
65 E char *xmlrpc_string(char *buf, const char *value);
66 E char *xmlrpc_integer(char *buf, int value);
67 E char *xmlrpc_time2date(char *buf, time_t t);
68
69 E int xmlrpc_set_options(int type, const char *value);
70 E void xmlrpc_set_buffer(char *(*func)(char *buffer, int len));
71 E void xmlrpc_generic_error(int code, const char *string);
72 E void xmlrpc_send(int argc, ...);
73 E void xmlrpc_send_string(const char *value);
74 E int xmlrpc_about(void *userdata, int ac, char **av);
75 E void xmlrpc_char_encode(char *outbuffer, const char *s1);
76 E char *xmlrpc_decode_string(char *buf);
77 E char *xmlrpc_normalizeBuffer(const char *buf);
78
79 #endif
80
81 /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
82 * vim:ts=8
83 * vim:sw=8
84 * vim:noexpandtab
85 */