Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmxmlrpc / xmlrpc_transport.h
blob1a451669abcd92e3f75d8329af00aa7585161d8a
1 /* Copyright information is at the end of the file */
2 #ifndef _XMLRPC_TRANSPORT_H_
3 #define _XMLRPC_TRANSPORT_H_ 1
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
9 #if defined(HAVE_PTHREADS)
10 # include "xmlrpc_pthreads.h" /* For threading helpers. */
11 #endif
13 struct call_info;
15 struct clientTransport;
17 /*=========================================================================
18 ** Transport function type declarations.
19 **=========================================================================
21 typedef void (*transport_create)(
22 xmlrpc_env * const envP,
23 int const flags,
24 const char * const appname,
25 const char * const appversion,
26 struct clientTransport ** const handlePP);
28 typedef void (*transport_destroy)(
29 struct clientTransport * const clientTransportP);
31 typedef void (*transport_asynch_complete)(
32 struct call_info * const callInfoP,
33 xmlrpc_mem_block * const responseXmlP,
34 xmlrpc_env const env);
36 typedef void (*transport_send_request)(
37 xmlrpc_env * const envP,
38 struct clientTransport * const clientTransportP,
39 xmlrpc_server_info * const serverP,
40 xmlrpc_mem_block * const xmlP,
41 transport_asynch_complete complete,
42 struct call_info * const callInfoP);
44 typedef void (*transport_call)(
45 xmlrpc_env * const envP,
46 struct clientTransport * const clientTransportP,
47 xmlrpc_server_info * const serverP,
48 xmlrpc_mem_block * const xmlP,
49 struct call_info * const callInfoP,
50 xmlrpc_mem_block ** const responsePP);
52 enum timeoutType {timeout_no, timeout_yes};
53 typedef void (*transport_finish_asynch)(
54 struct clientTransport * const clientTransportP,
55 enum timeoutType const timeoutType,
56 timeout_t const timeout);
59 struct clientTransportOps {
61 transport_create create;
62 transport_destroy destroy;
63 transport_send_request send_request;
64 transport_call call;
65 transport_finish_asynch finish_asynch;
68 /*=========================================================================
69 ** Transport Helper Functions and declarations.
70 **=========================================================================
72 #if defined(HAVE_PTHREADS)
73 typedef struct _running_thread_info
75 struct _running_thread_info * Next;
76 struct _running_thread_info * Last;
78 pthread_t _thread;
79 } running_thread_info;
82 /* list of running Async callback functions. */
83 typedef struct _running_thread_list
85 running_thread_info * AsyncThreadHead;
86 running_thread_info * AsyncThreadTail;
87 } running_thread_list;
89 /* MRB-WARNING: Only call when you have successfully
90 ** acquired the Lock/Unlock mutex! */
91 void register_asynch_thread (running_thread_list *list, pthread_t *thread);
93 /* MRB-WARNING: Only call when you have successfully
94 ** acquired the Lock/Unlock mutex! */
95 void unregister_asynch_thread (running_thread_list *list, pthread_t *thread);
96 #endif
99 #ifdef __cplusplus
101 #endif
103 /* Copyright (C) 2001 by First Peer, Inc. All rights reserved.
105 ** Redistribution and use in source and binary forms, with or without
106 ** modification, are permitted provided that the following conditions
107 ** are met:
108 ** 1. Redistributions of source code must retain the above copyright
109 ** notice, this list of conditions and the following disclaimer.
110 ** 2. Redistributions in binary form must reproduce the above copyright
111 ** notice, this list of conditions and the following disclaimer in the
112 ** documentation and/or other materials provided with the distribution.
113 ** 3. The name of the author may not be used to endorse or promote products
114 ** derived from this software without specific prior written permission.
116 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
117 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
118 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
119 ** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
120 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
121 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
122 ** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
123 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
124 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
125 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
126 ** SUCH DAMAGE. */
129 #endif