2 This file is part of libXMLRPC - a C library for xml-encoded function calls.
4 Author: Dan Libby (dan@libby.com)
5 Epinions.com may be contacted at feedback@epinions-inc.com
9 Copyright 2000 Epinions, Inc.
11 Subject to the following 3 conditions, Epinions, Inc. permits you, free
12 of charge, to (a) use, copy, distribute, modify, perform and display this
13 software and associated documentation files (the "Software"), and (b)
14 permit others to whom the Software is furnished to do so as well.
16 1) The above copyright notice and this permission notice shall be included
17 without modification in all copies or substantial portions of the
20 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF
21 ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY
22 IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 PURPOSE OR NONINFRINGEMENT.
25 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
26 SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT
27 OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING
28 NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH
33 /* only non-public things should be in this file. It is fine for any .c file
34 * in xmlrpc/src to include it, but users of the public API should never
35 * include it, and thus *.h files that are part of the public API should
36 * never include it, or they would break if this file is not present.
39 #ifndef XMLRPC_PRIVATE_ALREADY_INCLUDED
41 * Avoid include redundancy.
43 #define XMLRPC_PRIVATE_ALREADY_INCLUDED
50 /*----------------------------------------------------------------------------
54 * define non-public intra-library routines & data
58 /*----------------------------------------------------------------------------
63 /*----------------------------------------------------------------------------
67 /*----------------------------------------------------------------------------
71 /* Some of these are typedef'd in xmlrpc.h for public use */
73 typedef struct _xmlrpc_vector* XMLRPC_VECTOR;
75 /****s* VALUE/XMLRPC_VALUE
79 * A value of variable data type. The most important object in this API. :)
81 * This struct is opaque to callers and should be accessed only via accessor functions.
84 * XMLRPC_CreateValueEmpty ()
85 * XMLRPC_CleanupValue ()
88 typedef struct _xmlrpc_value {
89 XMLRPC_VALUE_TYPE type; /* data type of this value */
90 XMLRPC_VECTOR v; /* vector type specific info */
91 simplestring str; /* string value buffer */
92 simplestring id; /* id of this value. possibly empty. */
93 int i; /* integer value. */
94 double d; /* double value */
95 int iRefCount; /* So we know when we can delete the value . */
96 } STRUCT_XMLRPC_VALUE;
99 /****s* VALUE/XMLRPC_REQUEST
103 * Internal representation of an XML request.
105 * This struct is opaque to callers and should be accessed only via accessor functions.
109 * XMLRPC_RequestNew ()
110 * XMLRPC_RequestFree ()
113 typedef struct _xmlrpc_request {
114 XMLRPC_VALUE io; /* data associated with this request */
115 simplestring methodName; /* name of method being called */
116 XMLRPC_REQUEST_TYPE request_type; /* type of request */
117 STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS output; /* xml output options */
118 XMLRPC_VALUE error; /* error codes */
119 } STRUCT_XMLRPC_REQUEST;
122 /* Vector type. Used by XMLRPC_VALUE. Never visible to users of the API. */
123 typedef struct _xmlrpc_vector {
124 XMLRPC_VECTOR_TYPE type; /* vector type */
125 queue *q; /* list of child values */
126 } STRUCT_XMLRPC_VECTOR;
129 /****s* VALUE/XMLRPC_SERVER
133 * internal representation of an xmlrpc server
135 * This struct is opaque to callers and should be accessed only via accessor functions.
138 * XMLRPC_ServerCreate ()
139 * XMLRPC_ServerDestroy ()
142 typedef struct _xmlrpc_server {
143 queue methodlist; /* list of callback methods */
144 queue docslist; /* list of introspection callbacks */
145 XMLRPC_VALUE xIntrospection;
146 } STRUCT_XMLRPC_SERVER;
149 typedef struct _server_method {
152 XMLRPC_Callback method;
156 /*----------------------------------------------------------------------------
160 /*----------------------------------------------------------------------------
163 server_method* find_method(XMLRPC_SERVER server, const char* name);
164 const char* type_to_str(XMLRPC_VALUE_TYPE type, XMLRPC_VECTOR_TYPE vtype);
166 /*----------------------------------------------------------------------------
169 #define my_free(thing) if(thing) {free(thing); thing = 0;}
177 #endif /* XMLRPC_PRIVATE_ALREADY_INCLUDED */