initial load of upstream version 1.06.32
[xmlrpc-c] / include / xmlrpc-c / server.h
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/base.h>
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 typedef struct _xmlrpc_registry xmlrpc_registry;
13
14 typedef void
15 (*xmlrpc_preinvoke_method)(xmlrpc_env *   const envP,
16                            const char *   const methodName,
17                            xmlrpc_value * const paramArrayP,
18                            void *         const userData);
19
20 typedef xmlrpc_value *
21 (*xmlrpc_method)(xmlrpc_env *   const envP,
22                  xmlrpc_value * const paramArrayP,
23                  void *         const userData);
24
25 typedef xmlrpc_value *
26 (*xmlrpc_default_method)(xmlrpc_env *   const envP,
27                          const char *   const host,
28                          const char *   const methodName,
29                          xmlrpc_value * const paramArrayP,
30                          void *         const userData);
31
32 xmlrpc_registry *
33 xmlrpc_registry_new(xmlrpc_env * const envP);
34
35 void
36 xmlrpc_registry_free(xmlrpc_registry * const registryP);
37
38 void
39 xmlrpc_registry_disable_introspection(xmlrpc_registry * const registryP);
40
41 void
42 xmlrpc_registry_add_method(xmlrpc_env *      const envP,
43                            xmlrpc_registry * const registryP,
44                            const char *      const host,
45                            const char *      const methodName,
46                            xmlrpc_method     const method,
47                            void *            const userData);
48
49 void
50 xmlrpc_registry_add_method_w_doc(xmlrpc_env *      const envP,
51                                  xmlrpc_registry * const registryP,
52                                  const char *      const host,
53                                  const char *      const methodName,
54                                  xmlrpc_method     const method,
55                                  void *            const userData,
56                                  const char *      const signature,
57                                  const char *      const help);
58
59 void
60 xmlrpc_registry_set_default_method(xmlrpc_env *          const envP,
61                                    xmlrpc_registry *     const registryP,
62                                    xmlrpc_default_method const handler,
63                                    void *                const userData);
64
65 void
66 xmlrpc_registry_set_preinvoke_method(xmlrpc_env *            const envP,
67                                      xmlrpc_registry *       const registryP,
68                                      xmlrpc_preinvoke_method const method,
69                                      void *                  const userData);
70
71
72 typedef void xmlrpc_server_shutdown_fn(xmlrpc_env *, void *, const char *);
73     /* A function that shuts down a server that uses a registry.
74        Second argument is context specific to that function; third
75        argument is a comment to describe the shutdown.
76     */
77
78 void
79 xmlrpc_registry_set_shutdown(xmlrpc_registry *           const registryP,
80                              xmlrpc_server_shutdown_fn * const shutdownFn,
81                              void *                      const context);
82
83 /*----------------------------------------------------------------------------
84    Lower interface -- services to be used by an HTTP request handler
85 -----------------------------------------------------------------------------*/
86                     
87 xmlrpc_mem_block *
88 xmlrpc_registry_process_call(xmlrpc_env *      const envP,
89                              xmlrpc_registry * const registryP,
90                              const char *      const host,
91                              const char *      const xmlData,
92                              size_t            const xmlLen);
93
94 #ifdef __cplusplus
95 }
96 #endif
97
98 /* Copyright (C) 2001 by First Peer, Inc. All rights reserved.
99 **
100 ** Redistribution and use in source and binary forms, with or without
101 ** modification, are permitted provided that the following conditions
102 ** are met:
103 ** 1. Redistributions of source code must retain the above copyright
104 **    notice, this list of conditions and the following disclaimer.
105 ** 2. Redistributions in binary form must reproduce the above copyright
106 **    notice, this list of conditions and the following disclaimer in the
107 **    documentation and/or other materials provided with the distribution.
108 ** 3. The name of the author may not be used to endorse or promote products
109 **    derived from this software without specific prior written permission. 
110 **  
111 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
112 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
113 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
114 ** ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
115 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
116 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
117 ** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
118 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
119 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
120 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
121 ** SUCH DAMAGE. */
122 #endif