1 /* Copyright information is at the end of the file */ 2 #ifndef XMLRPC_TRANSPORT_H_INCLUDED 3 #define XMLRPC_TRANSPORT_H_INCLUDED 4 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 9 #include <xmlrpc-c/util.h> 10 #include <xmlrpc-c/client.h> 11 12 struct xmlrpc_call_info; 13 14 struct xmlrpc_client_transport; 15 16 /*========================================================================= 17 ** Transport function type declarations. 18 **========================================================================= 19 */ 20 typedef void (*xmlrpc_transport_setup)(xmlrpc_env * const envP); 21 22 typedef void (*xmlrpc_transport_teardown)(void); 23 24 typedef void (*xmlrpc_transport_create)( 25 xmlrpc_env * const envP, 26 int const flags, 27 const char * const appname, 28 const char * const appversion, 29 const void * const transportparmsP, 30 size_t const transportparm_size, 31 struct xmlrpc_client_transport ** const handlePP); 32 33 typedef void (*xmlrpc_transport_destroy)( 34 struct xmlrpc_client_transport * const clientTransportP); 35 36 typedef void (*xmlrpc_transport_asynch_complete)( 37 struct xmlrpc_call_info * const callInfoP, 38 xmlrpc_mem_block * const responseXmlP, 39 xmlrpc_env const env); 40 41 typedef void (*xmlrpc_transport_progress)( 42 struct xmlrpc_call_info * const callInfoP, 43 struct xmlrpc_progress_data const data); 44 45 typedef void (*xmlrpc_transport_send_request)( 46 xmlrpc_env * const envP, 47 struct xmlrpc_client_transport * const clientTransportP, 48 const xmlrpc_server_info * const serverP, 49 xmlrpc_mem_block * const xmlP, 50 xmlrpc_transport_asynch_complete complete, 51 xmlrpc_transport_progress progress, 52 struct xmlrpc_call_info * const callInfoP); 53 54 typedef void (*xmlrpc_transport_call)( 55 xmlrpc_env * const envP, 56 struct xmlrpc_client_transport * const clientTransportP, 57 const xmlrpc_server_info * const serverP, 58 xmlrpc_mem_block * const xmlP, 59 xmlrpc_mem_block ** const responsePP); 60 61 typedef enum {timeout_no, timeout_yes} xmlrpc_timeoutType; 62 63 typedef unsigned long xmlrpc_timeout; 64 /* A timeout in milliseconds. */ 65 66 typedef void (*xmlrpc_transport_finish_asynch)( 67 struct xmlrpc_client_transport * const clientTransportP, 68 xmlrpc_timeoutType const timeoutType, 69 xmlrpc_timeout const timeout); 70 71 typedef void (*xmlrpc_transport_set_interrupt)( 72 struct xmlrpc_client_transport * const clientTransportP, 73 int * const interruptP); 74 75 struct xmlrpc_client_transport_ops { 76 77 xmlrpc_transport_setup setup_global_const; 78 xmlrpc_transport_teardown teardown_global_const; 79 xmlrpc_transport_create create; 80 xmlrpc_transport_destroy destroy; 81 xmlrpc_transport_send_request send_request; 82 xmlrpc_transport_call call; 83 xmlrpc_transport_finish_asynch finish_asynch; 84 xmlrpc_transport_set_interrupt set_interrupt; 85 }; 86 87 extern int xmlrpc_trace_transport; 88 // This is nonzero to indicate that client XML transport logic should 89 // be traced. 90 91 #ifdef __cplusplus 92 } 93 #endif 94 95 #endif 96