⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stdsoap2.h

📁 linux下开发的soap协议。建议大家学习学习!
💻 H
📖 第 1 页 / 共 2 页
字号:
/*	stdsoap2.h 2.1.6The contents of this file are subject to the gSOAP Public License Version 1.0(the "License"); you may not use this file except in compliance with theLicense. You may obtain a copy of the License athttp://www.cs.fsu.edu/~engelen/soaplicense.htmlSoftware distributed under the License is distributed on an "AS IS" basis,WITHOUT WARRANTY OF ANY KIND, either express or implied. See the Licensefor the specific language governing rights and limitations under the License.The Initial Developer of the Original Code is Robert A. van Engelen.Copyright (C) 2000-2002 Robert A. van Engelen. All Rights Reserved.*/#ifdef WITH_SOAPDEFS_H#include "soapdefs.h"#endif#ifndef _THREAD_SAFE#define _THREAD_SAFE#endif#ifndef _REENTRANT#define _REENTRANT#endif#ifndef SOAP_FMAC1#define SOAP_FMAC1#endif#ifndef SOAP_FMAC2#define SOAP_FMAC2#endif#ifndef SOAP_CMAC#define SOAP_CMAC#endif#ifdef UNDER_CE#ifndef WIN32#define WIN32#endif#endif#ifdef __BORLANDC__#ifdef __WIN32__#ifndef WIN32#define WIN32#endif#endif#endif#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <limits.h>#ifndef UNDER_CE#include <errno.h>#include <sys/types.h>#include <time.h>#endif#if !defined(WIN32)#include <sys/socket.h>#include <strings.h>		/* AIX */#include <sys/socketvar.h>	/* AIX */#include <sys/time.h>#include <netinet/tcp.h>	/* for TCP_NODELAY */#include <arpa/inet.h>#endif#ifdef WITH_FASTCGI#include <fcgi_stdio.h>#endif#ifdef WITH_OPENSSL#include <openssl/ssl.h>#include <openssl/err.h>#ifndef ALLOW_OLD_VERSIONS#if (OPENSSL_VERSION_NUMBER < 0x00905100L)#error "Must use OpenSSL 0.9.6 or later"#endif#endif#endif#include <math.h>	/* for isnan(): remove if NaN and INF support is not required */#ifndef STDSOAP#define STDSOAP/* #define DEBUG */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and messages (in file TEST.log) */#ifdef __cplusplusextern "C" {#endif#ifdef WIN32#ifndef UNDER_CE#include <io.h>#endif#include <winsock.h>#else#include <netdb.h>#include <netinet/in.h>#include <unistd.h>#include <fcntl.h>#define closesocket(n) close(n)#endif#ifndef _MATH_H#define isnan(_) (0)#elseextern struct soap_double_nan { unsigned int n1, n2; } soap_double_nan;#endif#ifndef WIN32#define LONG64 long long#define ULONG64 unsigned LONG64#endif#ifdef __BORLANDC__#ifdef SYSMAC_H#define LONG64 ::LONG64#define ULONG64 ::ULONG64#endif#endif#ifdef WIN32#define SOAP_EINTR WSAEINTR#define SOAP_EAGAIN WSAEWOULDBLOCK#define SOAP_EWOULDBLOCK WSAEWOULDBLOCK#define SOAP_EINPROGRESS WSAEINPROGRESS#else#define SOAP_EINTR EINTR#define SOAP_EAGAIN EAGAIN#define SOAP_EWOULDBLOCK EWOULDBLOCK#define SOAP_EINPROGRESS EINPROGRESS#endif#ifdef UNDER_CE#define soap_errno GetLastError()#else#define soap_errno errno#endif#define SOAP_BUFLEN    8192 /* buffer length for socket packets, also used for gethostbyname buffer so don't make this too small */#define SOAP_PTRHASH   1024 /* size of pointer analysis hash table (must be power of 2) */#define SOAP_IDHASH      16 /* size of hash table for receiving element id/href's */#define SOAP_BLKLEN     256 /* size of blocks to collect long strings */#define SOAP_TAGLEN     256 /* maximum length of XML tag/attribute/element names + 1 */#define SOAP_MAXDIMS	 16 /* maximum array dimensions (array nestings) */#define SOAP_MAXLOGS	  3 /* max number of debug logs per soap environment */#define SOAP_INDEX_RECV	  0#define SOAP_INDEX_SENT	  1#define SOAP_INDEX_TEST	  2#ifndef FLT_NAN#ifdef _MATH_H#define FLT_NAN (*(float*)&soap_double_nan)#else#define FLT_NAN (0.0)#endif#endif#ifndef FLT_PINFTY#ifdef FLT_MAX#define FLT_PINFTY FLT_MAX#else#ifdef HUGE_VAL#define FLT_PINFTY (float)HUGE_VAL#else#ifdef FLOAT_MAX#define FLT_PINFTY FLOAT_MAX#else#define FLT_PINFTY (3.40282347e+38)#endif#endif#endif#endif#ifndef FLT_NINFTY#define FLT_NINFTY (-FLT_PINFTY)#endif#ifndef DBL_NAN#ifdef _MATH_H#define DBL_NAN (*(double*)&soap_double_nan)#else#define DBL_NAN (0.0)#endif#endif#ifndef DBL_PINFTY#ifdef DBL_MAX#define DBL_PINFTY DBL_MAX#else#ifdef HUGE_VAL#define DBL_PINFTY (double)HUGE_VAL#else#ifdef DOUBLE_MAX#define DBL_PINFTY DOUBLE_MAX#else#define DBL_PINFTY (1.7976931348623157e+308)#endif#endif#endif#endif#ifndef DBL_NINFTY#define DBL_NINFTY (-DBL_PINFTY)#endif/* gSOAP error codes */#define SOAP_EOF EOF#define SOAP_OK 0#define SOAP_CLI_FAULT 1#define SOAP_SVR_FAULT 2#define SOAP_TAG_MISMATCH 3#define SOAP_TYPE_MISMATCH 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_OBJ_MISMATCH 10#define SOAP_FATAL_ERROR 11#define SOAP_FAULT 12#define SOAP_NO_METHOD 13#define SOAP_EOM 14#define SOAP_NULL 15#define SOAP_MULTI_ID 16#define SOAP_MISSING_ID 17#define SOAP_HREF 18#define SOAP_TCP_ERROR 19#define SOAP_HTTP_ERROR 20#define SOAP_SSL_ERROR 21#define SOAP_DIME_ERROR 22#define SOAP_EOD 23#define SOAP_VERSIONMISMATCH 24#define SOAP_DIME_VERSIONMISMATCH 25/* gSOAP DIME */#define SOAP_DIME_CF 0x1#define SOAP_DIME_ME 0x2#define SOAP_DIME_MB 0x4#define SOAP_DIME_VERSION 0x8 /* DIME version 1 */#define SOAP_DIME_MEDIA 0x10#define SOAP_DIME_ABSURI 0x20/* DEBUG macros */#ifndef UNDER_CE#ifdef DEBUG#ifndef SOAP_DEBUG#define SOAP_DEBUG#endif#endif#endif#ifdef SOAP_DEBUG#ifndef SOAP_MESSAGE#define SOAP_MESSAGE fprintf#endif#define DBGLOG(DBGFILE, DBGCMD) \{ if (soap)\  { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\      soap_open_logfile(soap, SOAP_INDEX_##DBGFILE);\    if (soap->fdebug[SOAP_INDEX_##DBGFILE])\    { FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\      DBGCMD;\      fflush(fdebug);\    }\  }\}#else#define DBGLOG(DBGFILE, DBGCMD)#endiftypedef long wchar; /* for compatibility */struct Namespace{ const char *id;  const char *ns;  const char *in;  char *out;};struct soap_nlist{ struct soap_nlist *next;  char *id;  int level;  int index;};struct soap_blist{ struct soap_blist *next;  char *ptr;  size_t size;};struct soap_ilist{ struct soap_ilist *next;  int type;  size_t size;  void *link;  void *copy;  void *ptr;  int level;  char id[4]; /* the actual string value overflows into allocated region below this struct */};struct soap_plist{ struct soap_plist *next;  void *ptr;  int type;  int id;  char mark1;  char mark2;};struct soap_clist{ struct soap_clist *next;  void *ptr;  int type;  size_t size;};#ifdef WITH_COOKIESstruct soap_cookie{ struct soap_cookie *next;  char *name;  char *value;  char *domain;  char *path;  long expire;		/* client-side: local time to expire; server-side: seconds to expire */  unsigned int version;  short secure;  short session;	/* server-side */  short env;		/* server-side: got cookie from client */  short modified;	/* server-side: client cookie was modified */};#endifstruct soap{ const char *float_format;	/* points to user-definable format string for floats (<1024 chars) */  const char *double_format;	/* points to user-definable format string for doubles (<1024 chars) */  const char *dime_id_format;	/* points to user-definable format string for integer DIME id (<SOAP_TAGLEN chars) */  const char *http_version;	/* default = "1.0" */  const char *encodingStyle;	/* default = NULL which means that SOAP encoding is used */  const char *defaultNamespace;	/* default = NULL which means that no default namespace is set */  const char *actor;  short keep_alive;		/* when !=0, attempt to keep connections open */  short chunked_transfer;	/* when !=0, use chunked transfer (soap.count will be incorrect) */  short disable_href;		/* when !=0, disables hrefs so objects are duplicated on the output */  short enable_embedding;	/* when !=0, enable hrefs within embedded elements */  short enable_null;		/* when !=0, always sends null elements */  short enable_utf_string;	/* when !=0, assume strings are UTF8/16 encoded and just emit them */  short disable_request_count;	/* when !=0, do not count message length for requests */  short disable_response_count; /* when !=0, do not count message length for responses */  short enable_array_overflow;  /* when !=0, ignore elements that do not fit in a fixed-size array */   int recv_timeout;		/* when > 0, gives socket recv timeout in seconds, < 0 in usec */  int send_timeout;		/* when > 0, gives socket send timeout in seconds, < 0 in usec */  int connect_timeout;		/* when > 0, gives socket connect() timeout in seconds, < 0 in usec */  int accept_timeout;		/* when > 0, gives socket accept() timeout in seconds, < 0 in usec */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -