initial load of upstream version 1.06.32
[xmlrpc-c] / include / xmlrpc-c / server_w32httpsys.h
1 /* Copyright (C) 2005 by Steven A. Bone, sbone@pobox.com. All rights reserved.
2 **
3 ** Redistribution and use in source and binary forms, with or without
4 ** modification, are permitted provided that the following conditions
5 ** are met:
6 ** 1. Redistributions of source code must retain the above copyright
7 **    notice, this list of conditions and the following disclaimer.
8 ** 2. Redistributions in binary form must reproduce the above copyright
9 **    notice, this list of conditions and the following disclaimer in the
10 **    documentation and/or other materials provided with the distribution.
11 ** 3. The name of the author may not be used to endorse or promote products
12 **    derived from this software without specific prior written permission. 
13 **  
14 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 ** ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 ** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 ** SUCH DAMAGE. */
25
26 /* COMPILATION NOTE:
27    Note that the Platform SDK headers and
28    link libraries for Windows XP SP2 or newer are required to compile
29    xmlrpc-c for this module.  If you are not using this server, it is 
30    safe to exclude the xmlrpc_server_w32httpsys.c file from the xmlrpc
31    project and these dependencies will not be required.  You can get the 
32    latest platform SDK at 
33    http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
34    Be sure after installation to choose the program to "register the PSDK
35    directories with Visual Studio" so the newer headers are found.
36 */
37
38 #ifndef  _XMLRPC_SERVER_HTTPSYS_H_
39 #define  _XMLRPC_SERVER_HTTPSYS_H_ 1
40
41 #include "transport_config.h"
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif /* __cplusplus */
46
47 /*=========================================================================
48 **  XML-RPC Server (based on HTTP.SYS)
49 **=========================================================================
50 **  A simple XML-RPC server based on the "built-in" Windows web server,
51 **  HTTP.SYS.  This is provided by Microsoft in Windows XP SP2 and 
52 **  Windows Server 2003.  If errors occur during server setup, the server
53 **  will exit. In general, if you want to use this API, you do not really
54 **  need to be familiar with the HTTP.SYS API.
55 */
56
57 typedef void (*authorization_function)(
58                                  xmlrpc_env * envP,
59                  char * userid,
60                  char * password);
61
62 typedef struct {
63     xmlrpc_registry * registryP;
64         unsigned int      portNum;
65         unsigned int      useSSL;
66         /* useSSL, 0 = no SSL, 1 = use SSL */
67         unsigned int      logLevel;
68         /* logLevel, 0 = none, 1 = file, 2 = file+OutputDebugString() */
69         const char *      logFile;
70         /* logFile, NULL or filename */
71         authorization_function authfn;
72 } xmlrpc_server_httpsys_parms;
73
74 #define XMLRPC_HSSIZE(MBRNAME) \
75     XMLRPC_STRUCTSIZE(xmlrpc_server_httpsys_parms, MBRNAME)
76
77 /* XMLRPC_HSSIZE(xyz) is the minimum size a struct xmlrpc_server_httpsys_parms
78    must be to include the 'xyz' member.  This is essential for forward and
79    backward compatbility, as new members will be added to the end of the
80    struct in future releases.  This is how the callee knows whether or
81    not the caller is new enough to have supplied a certain parameter.
82 */
83
84 void
85 xmlrpc_server_httpsys(
86         xmlrpc_env *                        const envP,
87     const xmlrpc_server_httpsys_parms * const parmsP,
88     unsigned int                        const parm_size
89         );
90
91 #ifdef __cplusplus
92 }
93 #endif /* __cplusplus */
94
95 #endif