📄 stdsoap2.h
字号:
#ifndef SOAP_MAXARRAYSIZE# define SOAP_MAXARRAYSIZE (100000) /* "trusted" max size of inbound SOAP array for compound array allocation */#endif#ifdef VXWORKS# ifdef __INCmathh # include <private/mathP.h># ifndef HAVE_ISNAN# define HAVE_ISNAN# endif# define soap_isnan(num) isNan(num)# endif#endif#ifdef WIN32 # include <float.h># ifndef HAVE_ISNAN# define HAVE_ISNAN# endif# define soap_isnan(num) _isnan(num)#endif#ifdef SUN_OS# define HAVE_ISNAN#endif#ifdef __APPLE__# ifdef __cplusplus# ifndef isnanextern "C" int isnan(double);# endif# endif# define HAVE_ISNAN#endif#if !defined(HAVE_ISNAN) && (defined(_MATH_H) || defined(_MATH_INCLUDED))# define HAVE_ISNAN#endifextern const struct soap_double_nan { unsigned int n1, n2; } soap_double_nan;#ifdef VXWORKS# ifndef FLT_MAX# define FLT_MAX _ARCH_FLT_MAX# endif# ifndef DBL_MAX# define DBL_MAX _ARCH_DBL_MAX# endif#endif#ifndef FLT_NAN# define FLT_NAN (*(float*)(void*)&soap_double_nan)#endif#ifndef FLT_PINFTY# if defined(FLT_MAX)# define FLT_PINFTY FLT_MAX# elif defined(HUGE_VALF)# define FLT_PINFTY (float)HUGE_VALF# elif defined(HUGE_VAL)# define FLT_PINFTY (float)HUGE_VAL# elif defined(FLOAT_MAX)# define FLT_PINFTY FLOAT_MAX# else# define FLT_PINFTY (3.40282347e+38F)# endif#endif#ifndef FLT_NINFTY# define FLT_NINFTY (-FLT_PINFTY)#endif#ifndef DBL_NAN# define DBL_NAN (*(double*)(void*)&soap_double_nan)#endif#ifndef DBL_PINFTY# if defined(DBL_MAX)# define DBL_PINFTY DBL_MAX# elif defined(HUGE_VALF)# define DBL_PINFTY (double)HUGE_VALF# elif defined(HUGE_VAL)# define DBL_PINFTY (double)HUGE_VAL# elif defined(DOUBLE_MAX)# define DBL_PINFTY DOUBLE_MAX# else# define DBL_PINFTY (1.7976931348623157e+308)# endif#endif#ifndef DBL_NINFTY# define DBL_NINFTY (-DBL_PINFTY)#endif#ifndef soap_isnan# ifdef HAVE_ISNAN# define soap_isnan(n) isnan(n)# else# define soap_isnan(n) (0)# endif#endif#define soap_ispinfd(n) ((n) >= DBL_PINFTY)#define soap_ispinff(n) ((n) >= FLT_PINFTY)#define soap_isninfd(n) ((n) <= DBL_NINFTY)#define soap_isninff(n) ((n) <= FLT_NINFTY)/* gSOAP error codes */#define SOAP_EOF EOF#define SOAP_ERR EOF#define SOAP_OK 0#define SOAP_CLI_FAULT 1#define SOAP_SVR_FAULT 2#define SOAP_TAG_MISMATCH 3#define SOAP_TYPE 4#define SOAP_SYNTAX_ERROR 5#define SOAP_NO_TAG 6#define SOAP_IOB 7#define SOAP_MUSTUNDERSTAND 8#define SOAP_NAMESPACE 9#define SOAP_USER_ERROR 10#define SOAP_FATAL_ERROR 11#define SOAP_FAULT 12#define SOAP_NO_METHOD 13#define SOAP_NO_DATA 14#define SOAP_GET_METHOD 15#define SOAP_EOM 16#define SOAP_MOE 17#define SOAP_HDR 18#define SOAP_NULL 19#define SOAP_DUPLICATE_ID 20#define SOAP_MISSING_ID 21#define SOAP_HREF 22#define SOAP_UDP_ERROR 23#define SOAP_TCP_ERROR 24#define SOAP_HTTP_ERROR 25#define SOAP_SSL_ERROR 26#define SOAP_ZLIB_ERROR 27#define SOAP_DIME_ERROR 28#define SOAP_DIME_HREF 29#define SOAP_DIME_MISMATCH 30#define SOAP_DIME_END 31#define SOAP_MIME_ERROR 32#define SOAP_MIME_HREF 33#define SOAP_MIME_END 34#define SOAP_VERSIONMISMATCH 35#define SOAP_PLUGIN_ERROR 36#define SOAP_DATAENCODINGUNKNOWN 37#define SOAP_REQUIRED 38#define SOAP_PROHIBITED 39#define SOAP_OCCURS 40#define SOAP_LENGTH 41#define SOAP_FD_EXCEEDED 42#define soap_xml_error_check(e) ((e) == SOAP_TAG_MISMATCH || (e) == SOAP_NO_TAG || (e) == SOAP_SYNTAX_ERROR || (e) == SOAP_NAMESPACE || (e) == SOAP_DUPLICATE_ID || (e) == SOAP_MISSING_ID || (e) == SOAP_REQUIRED || (e) == SOAP_PROHIBITED || (e) == SOAP_OCCURS || (e) == SOAP_LENGTH || (e) == SOAP_NULL || (e) == SOAP_HREF)#define soap_soap_error_check(e) ((e) == SOAP_CLI_FAULT || (e) == SOAP_SVR_FAULT || (e) == SOAP_VERSIONMISMATCH || (e) == SOAP_MUSTUNDERSTAND || (e) == SOAP_FAULT || (e) == SOAP_NO_METHOD)#define soap_tcp_error_check(e) ((e) == SOAP_EOF || (e) == SOAP_TCP_ERROR)#define soap_ssl_error_check(e) ((e) == SOAP_SSL_ERROR)#define soap_zlib_error_check(e) ((e) == SOAP_ZLIB_ERROR)#define soap_http_error_check(e) ((e) == SOAP_HTTP_ERROR || (e) == SOAP_GET_METHOD || (e) == SOAP_NO_DATA || ((e) >= 100 && (e) < 600))/* gSOAP HTTP response status codes 100 to 599 are reserved *//* Codes 600 to 999 are user definable *//* Exceptional gSOAP HTTP response status codes >= 1000 */#define SOAP_STOP 1000 /* No HTTP response */#define SOAP_FORM 1001 /* Form request/response */#define SOAP_HTML 1002 /* Custom HTML response */#define SOAP_FILE 1003 /* Custom file-based response *//* gSOAP HTTP method codes */#define SOAP_POST 2000#define SOAP_GET 2001/* gSOAP DIME */#define SOAP_DIME_CF 0x01#define SOAP_DIME_ME 0x02#define SOAP_DIME_MB 0x04#define SOAP_DIME_VERSION 0x08 /* DIME version 1 */#define SOAP_DIME_MEDIA 0x10#define SOAP_DIME_ABSURI 0x20/* gSOAP ZLIB */#define SOAP_ZLIB_NONE 0x00#define SOAP_ZLIB_DEFLATE 0x01#define SOAP_ZLIB_INFLATE 0x02#define SOAP_ZLIB_GZIP 0x02/* gSOAP transport, connection, and content encoding modes */typedef soap_int32 soap_mode;#define SOAP_IO 0x00000003 /* IO mask */#define SOAP_IO_FLUSH 0x00000000 /* flush output immediately, no buffering */#define SOAP_IO_BUFFER 0x00000001 /* buffer output in packets of size SOAP_BUFLEN */#define SOAP_IO_STORE 0x00000002 /* store entire output to determine length for transport */#define SOAP_IO_CHUNK 0x00000003 /* use HTTP chunked transfer AND buffer packets */#define SOAP_IO_UDP 0x00000004 /* TCP or UDP */#define SOAP_IO_LENGTH 0x00000008 /* calc message length (internal) */#define SOAP_IO_KEEPALIVE 0x00000010 /* keep connection alive */#define SOAP_ENC_LATIN 0x00000020 /* accept iso-8859-1 encoding */#define SOAP_ENC_XML 0x00000040 /* plain XML encoding, no HTTP header */#define SOAP_ENC_DIME 0x00000080#define SOAP_ENC_MIME 0x00000100#define SOAP_ENC_MTOM 0x00000200#define SOAP_ENC_ZLIB 0x00000400#define SOAP_ENC_SSL 0x00000800#define SOAP_ENC 0x00000FFF /* IO and ENC mask */#define SOAP_XML_STRICT 0x00001000 /* apply strict validation */#define SOAP_XML_INDENT 0x00002000 /* emit indented XML */#define SOAP_XML_CANONICAL 0x00004000 /* EXC C14N canonical XML */#define SOAP_XML_TREE 0x00008000 /* emit XML tree (no id/ref) */#define SOAP_XML_GRAPH 0x00010000#define SOAP_XML_NIL 0x00020000#define SOAP_XML_DOM 0x00040000#define SOAP_XML_SEC 0x00080000 /* reserved for WS security */#define SOAP_C_NOIOB 0x00100000 /* don't fault on array index out of bounds (just ignore) */#define SOAP_C_UTFSTRING 0x00200000 /* (de)serialize strings with UTF8 content */#define SOAP_C_MBSTRING 0x00400000 /* (de)serialize strings with multi-byte content */#define SOAP_C_NILSTRING 0x00800000 /* serialize empty strings as nil (omitted) */#define SOAP_DOM_TREE 0x01000000#define SOAP_DOM_NODE 0x02000000#define SOAP_DOM_ASIS 0x04000000#define SOAP_MIME_POSTCHECK 0x10000000 /* MIME flag (internal) */#define SOAP_IO_DEFAULT SOAP_IO_FLUSH/* SSL client/server authentication settings */#define SOAP_SSL_NO_AUTHENTICATION 0x00 /* for testing purposes */#define SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION 0x01 /* client requires server to authenticate */#define SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION 0x02 /* server requires client to authenticate */#define SOAP_SSL_SKIP_HOST_CHECK 0x04 /* client does not check the common name of the host in certificate */#define SOAP_SSL_RSA 0x08 /* use RSA */#define SOAP_SSLv3_TLSv1 0x00 /* SSL v3 and TLS v1 support by default */#define SOAP_SSLv3 0x10 /* SSL v3 only */#define SOAP_TLSv1 0x20 /* TLS v1 only */#define SOAP_SSL_DEFAULT (SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION | SOAP_SSLv3_TLSv1)/* state */#define SOAP_INIT 1#define SOAP_COPY 2#define soap_check_state(soap) (!(soap) || ((soap)->state != SOAP_INIT && (soap)->state != SOAP_COPY))/* part */#define SOAP_BEGIN 0#define SOAP_IN_ENVELOPE 2#define SOAP_IN_HEADER 3#define SOAP_END_HEADER 4#define SOAP_NO_BODY 5#define SOAP_IN_BODY 6#define SOAP_END_BODY 7#define SOAP_END_ENVELOPE 8#define SOAP_END 9#define SOAP_BEGIN_SECURITY 10#define SOAP_IN_SECURITY 11#define SOAP_END_SECURITY 12/* DEBUG macros */#ifndef WITH_LEAN# ifdef DEBUG# ifndef SOAP_DEBUG# define SOAP_DEBUG# endif# ifndef SOAP_MEM_DEBUG# define SOAP_MEM_DEBUG# endif# endif#endif#ifdef SOAP_MEM_DEBUG# ifndef SOAP_MALLOC# define SOAP_MALLOC(soap, size) soap_track_malloc(soap, __FILE__, __LINE__, size)# endif# ifndef SOAP_FREE# define SOAP_FREE(soap, ptr) soap_track_free(soap, __FILE__, __LINE__, ptr)# endif#endif#ifndef SOAP_MALLOC /* use libc malloc */# define SOAP_MALLOC(soap, size) malloc(size)#endif#ifndef SOAP_FREE /* use libc free */# define SOAP_FREE(soap, ptr) free(ptr)#endif#ifdef SOAP_DEBUG# ifndef SOAP_MESSAGE# define SOAP_MESSAGE fprintf# endif# ifndef DBGLOG# define DBGLOG(DBGFILE, CMD) \{ if (soap)\ { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ { FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\ CMD;\ fflush(fdebug);\ }\ }\}# endif# ifndef DBGMSG# define DBGMSG(DBGFILE, MSG, LEN) \{ if (soap)\ { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ { fwrite((MSG), 1, (LEN), soap->fdebug[SOAP_INDEX_##DBGFILE]);\ fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\ }\ }\}# endif# ifndef DGBFUN# define DBGFUN(FNAME) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s()\n", __FILE__, __LINE__, FNAME))# define DBGFUN1(FNAME, FMT, ARG) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s("FMT")\n", __FILE__, __LINE__, FNAME, (ARG)))# define DBGFUN2(FNAME, FMT1, ARG1, FMT2, ARG2) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s("FMT1", "FMT2")\n", __FILE__, __LINE__, FNAME, (ARG1), (ARG2)))# define DBGFUN3(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s("FMT1", "FMT2", "FMT3")\n", __FILE__, __LINE__, FNAME, (ARG1), (ARG2), (ARG3)))# endif# ifndef DBGHEX# define DBGHEX(DBGFILE, MSG, LEN) \{ if (soap)\ { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ soap_open_logfile(soap, SOAP_INDEX_##DBGFILE);\ if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ { int i; char *s;\ for (s = (char*)(MSG), i = (LEN); i; i--)\ fprintf(soap->fdebug[SOAP_INDEX_##DBGFILE], "%2.2X ", (int)*s++&0xFF);\ fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\ }\ }\}# endif#else# define DBGLOG(DBGFILE, CMD)# define DBGMSG(DBGFILE, MSG, LEN)# define DBGFUN(FNAME)# define DBGFUN1(FNAME, FMT, ARG)# define DBGFUN2(FNAME, FMT1, ARG1, FMT2, ARG2)# define DBGFUN3(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3)# define DBGHEX(DBGFILE, MSG, LEN)#endif/* UCS-4 requires 32 bits (0-7FFFFFFF, the sign bit is used by gSOAP to distinguish XML entities) */typedef soap_int32 soap_wchar;/* namespace table row */struct Namespace{ const char *id; const char *ns; const char *in; char *out;};/* namespace stack */struct soap_nlist{ struct soap_nlist *next; unsigned int level; /* nesting depth level */ short index; /* corresponding entry in ns mapping table */ char *ns; /* only set when parsed ns URI is not in the ns mapping table */ char id[1]; /* the actual string value flows into the allocated region below this struct */};/* block stack for nested block allocations */struct soap_blist{ struct soap_blist *next; char *ptr; size_t size;};/* array layout */struct soap_array{ void *__ptr; int __size;};/* pointer serialization management */struct soap_plist{ struct soap_plist *next; const void *ptr; const struct soap_array *array; int type; int id; char mark1; char mark2;};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -