1 /* Copyright and license information is at the end of the file */ 2 3 #ifndef XMLRPC_SERVER_H_INCLUDED 4 #define XMLRPC_SERVER_H_INCLUDED 5 6 #include <xmlrpc-c/c_util.h> /* For XMLRPC_DLLEXPORT */ 7 #include <xmlrpc-c/base.h> 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /* 14 XMLRPC_SERVER_EXPORTED marks a symbol in this file that is exported from 15 libxmlrpc_server. 16 17 XMLRPC_BUILDING_SERVER says this compilation is part of libxmlrpc_server, as 18 opposed to something that _uses_ libxmlrpc_server. 19 */ 20 #ifdef XMLRPC_BUILDING_SERVER 21 #define XMLRPC_SERVER_EXPORTED XMLRPC_DLLEXPORT 22 #else 23 #define XMLRPC_SERVER_EXPORTED 24 #endif 25 26 typedef struct xmlrpc_registry xmlrpc_registry; 27 28 typedef void 29 (*xmlrpc_preinvoke_method)(xmlrpc_env * const envP, 30 const char * const methodName, 31 xmlrpc_value * const paramArrayP, 32 void * const userData); 33 34 typedef xmlrpc_value * 35 (*xmlrpc_method1)(xmlrpc_env * const envP, 36 xmlrpc_value * const paramArrayP, 37 void * const serverInfo); 38 39 typedef xmlrpc_value * 40 (*xmlrpc_method2)(xmlrpc_env * const envP, 41 xmlrpc_value * const paramArrayP, 42 void * const serverInfo, 43 void * const callInfo); 44 45 typedef xmlrpc_method1 xmlrpc_method; /* backward compatibility */ 46 47 typedef xmlrpc_value * 48 (*xmlrpc_default_method)(xmlrpc_env * const envP, 49 const char * const callInfoP, 50 const char * const methodName, 51 xmlrpc_value * const paramArrayP, 52 void * const serverInfo); 53 54 /* These are for backward compatibility -- they can't be exported from a 55 Windows DLL. xmlrpc_server_version() is preferred. 56 */ 57 extern unsigned int const xmlrpc_server_version_major; 58 extern unsigned int const xmlrpc_server_version_minor; 59 extern unsigned int const xmlrpc_server_version_point; 60 61 XMLRPC_SERVER_EXPORTED 62 void 63 xmlrpc_server_version(unsigned int * const majorP, 64 unsigned int * const minorP, 65 unsigned int * const pointP); 66 67 XMLRPC_SERVER_EXPORTED 68 xmlrpc_registry * 69 xmlrpc_registry_new(xmlrpc_env * const envP); 70 71 XMLRPC_SERVER_EXPORTED 72 void 73 xmlrpc_registry_free(xmlrpc_registry * const registryP); 74 75 XMLRPC_SERVER_EXPORTED 76 void 77 xmlrpc_registry_disable_introspection(xmlrpc_registry * const registryP); 78 79 XMLRPC_SERVER_EXPORTED 80 void 81 xmlrpc_registry_add_method(xmlrpc_env * const envP, 82 xmlrpc_registry * const registryP, 83 const char * const host, 84 const char * const methodName, 85 xmlrpc_method const method, 86 void * const serverInfo); 87 88 XMLRPC_SERVER_EXPORTED 89 void 90 xmlrpc_registry_add_method_w_doc(xmlrpc_env * const envP, 91 xmlrpc_registry * const registryP, 92 const char * const host, 93 const char * const methodName, 94 xmlrpc_method const method, 95 void * const serverInfo, 96 const char * const signatureString, 97 const char * const help); 98 99 XMLRPC_SERVER_EXPORTED 100 void 101 xmlrpc_registry_add_method2(xmlrpc_env * const envP, 102 xmlrpc_registry * const registryP, 103 const char * const methodName, 104 xmlrpc_method2 method, 105 const char * const signatureString, 106 const char * const help, 107 void * const serverInfo); 108 109 struct xmlrpc_method_info3 { 110 const char * methodName; 111 xmlrpc_method2 methodFunction; 112 void * serverInfo; 113 size_t stackSize; 114 const char * signatureString; 115 const char * help; 116 }; 117 118 XMLRPC_SERVER_EXPORTED 119 void 120 xmlrpc_registry_add_method3( 121 xmlrpc_env * const envP, 122 xmlrpc_registry * const registryP, 123 const struct xmlrpc_method_info3 * const infoP); 124 125 XMLRPC_SERVER_EXPORTED 126 void 127 xmlrpc_registry_set_default_method(xmlrpc_env * const envP, 128 xmlrpc_registry * const registryP, 129 xmlrpc_default_method const handler, 130 void * const userData); 131 132 XMLRPC_SERVER_EXPORTED 133 void 134 xmlrpc_registry_set_preinvoke_method(xmlrpc_env * const envP, 135 xmlrpc_registry * const registryP, 136 xmlrpc_preinvoke_method const method, 137 void * const userData); 138 139 140 typedef void xmlrpc_server_shutdown_fn(xmlrpc_env * const envP, 141 void * const context, 142 const char * const comment, 143 void * const callInfo); 144 145 XMLRPC_SERVER_EXPORTED 146 void 147 xmlrpc_registry_set_shutdown(xmlrpc_registry * const registryP, 148 xmlrpc_server_shutdown_fn * const shutdownFn, 149 void * const context); 150 151 XMLRPC_SERVER_EXPORTED 152 void 153 xmlrpc_registry_set_dialect(xmlrpc_env * const envP, 154 xmlrpc_registry * const registryP, 155 xmlrpc_dialect const dialect); 156 157 /*---------------------------------------------------------------------------- 158 Lower interface -- services to be used by an HTTP request handler 159 -----------------------------------------------------------------------------*/ 160 161 XMLRPC_SERVER_EXPORTED 162 void 163 xmlrpc_registry_process_call2(xmlrpc_env * const envP, 164 xmlrpc_registry * const registryP, 165 const char * const xmlData, 166 size_t const xmlLen, 167 void * const callInfo, 168 xmlrpc_mem_block ** const outputPP); 169 170 XMLRPC_SERVER_EXPORTED 171 xmlrpc_mem_block * 172 xmlrpc_registry_process_call(xmlrpc_env * const envP, 173 xmlrpc_registry * const registryP, 174 const char * const host, 175 const char * const xmlData, 176 size_t const xmlLen); 177 178 XMLRPC_SERVER_EXPORTED 179 size_t 180 xmlrpc_registry_max_stackSize(xmlrpc_registry * const registryP); 181 182 #ifdef __cplusplus 183 } 184 #endif 185 186 /* Copyright (C) 2001 by First Peer, Inc. All rights reserved. 187 ** 188 ** Redistribution and use in source and binary forms, with or without 189 ** modification, are permitted provided that the following conditions 190 ** are met: 191 ** 1. Redistributions of source code must retain the above copyright 192 ** notice, this list of conditions and the following disclaimer. 193 ** 2. Redistributions in binary form must reproduce the above copyright 194 ** notice, this list of conditions and the following disclaimer in the 195 ** documentation and/or other materials provided with the distribution. 196 ** 3. The name of the author may not be used to endorse or promote products 197 ** derived from this software without specific prior written permission. 198 ** 199 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 200 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 201 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 202 ** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 203 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 204 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 205 ** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 206 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 207 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 208 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 209 ** SUCH DAMAGE. */ 210 #endif 211