1 /* 2 stdsoap2.h 2.7.12 3 4 gSOAP runtime engine 5 6 gSOAP XML Web services tools 7 Copyright (C) 2000-2008, Robert van Engelen, Genivia Inc., All Rights Reserved. 8 This part of the software is released under ONE of the following licenses: 9 GPL, or the gSOAP public license, or Genivia's license for commercial use. 10 -------------------------------------------------------------------------------- 11 Contributors: 12 13 Wind River Systems, Inc., for the following additions 14 - vxWorks compatible 15 -------------------------------------------------------------------------------- 16 gSOAP public license. 17 18 The contents of this file are subject to the gSOAP Public License Version 1.3 19 (the "License"); you may not use this file except in compliance with the 20 License. You may obtain a copy of the License at 21 http://www.cs.fsu.edu/~engelen/soaplicense.html 22 Software distributed under the License is distributed on an "AS IS" basis, 23 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 24 for the specific language governing rights and limitations under the License. 25 26 The Initial Developer of the Original Code is Robert A. van Engelen. 27 Copyright (C) 2000-2008, Robert van Engelen, Genivia Inc., All Rights Reserved. 28 -------------------------------------------------------------------------------- 29 GPL license. 30 31 This program is free software; you can redistribute it and/or modify it under 32 the terms of the GNU General Public License as published by the Free Software 33 Foundation; either version 2 of the License, or (at your option) any later 34 version. 35 36 This program is distributed in the hope that it will be useful, but WITHOUT ANY 37 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 38 PARTICULAR PURPOSE. See the GNU General Public License for more details. 39 40 You should have received a copy of the GNU General Public License along with 41 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 42 Place, Suite 330, Boston, MA 02111-1307 USA 43 44 Author contact information: 45 engelen (at) genivia.com / engelen (at) acm.org 46 47 This program is released under the GPL with the additional exemption that 48 compiling, linking, and/or using OpenSSL is allowed. 49 -------------------------------------------------------------------------------- 50 A commercial use license is available from Genivia, Inc., contact (at) genivia.com 51 -------------------------------------------------------------------------------- 52 */ 53 54 #ifdef WITH_SOAPDEFS_H 55 # include "soapdefs.h" /* include user-defined stuff */ 56 #endif 57 58 #ifndef _THREAD_SAFE 59 # define _THREAD_SAFE 60 #endif 61 62 #ifndef OPENSERVER 63 # ifndef _REENTRANT 64 # define _REENTRANT 65 # endif 66 #endif 67 68 #ifndef SOAP_FMAC1 /* stdsoap2.h declaration macro */ 69 # define SOAP_FMAC1 70 #endif 71 72 #ifndef SOAP_FMAC2 /* stdsoap2.h declaration macro */ 73 # define SOAP_FMAC2 74 #endif 75 76 #ifndef SOAP_FMAC3 /* (de)serializer declaration macro */ 77 # define SOAP_FMAC3 78 #endif 79 80 #ifndef SOAP_FMAC3S /* string converter for (de)serializer declaration macro */ 81 # define SOAP_FMAC3S SOAP_FMAC3 82 #endif 83 84 #ifndef SOAP_FMAC4 /* (de)serializer declaration macro */ 85 # define SOAP_FMAC4 86 #endif 87 88 #ifndef SOAP_FMAC4S /* string converter for (de)serializer declaration macro */ 89 # define SOAP_FMAC4S SOAP_FMAC4 90 #endif 91 92 #ifndef SOAP_FMAC5 /* stub/skeleton declaration macro */ 93 # define SOAP_FMAC5 94 #endif 95 96 #ifndef SOAP_FMAC6 /* stub/skeleton declaration macro */ 97 # define SOAP_FMAC6 98 #endif 99 100 #ifndef SOAP_CMAC /* class declaration macro */ 101 # define SOAP_CMAC 102 #endif 103 104 #ifndef SOAP_NMAC /* namespace table declaration macro */ 105 # define SOAP_NMAC 106 #endif 107 108 #ifndef SOAP_SOURCE_STAMP 109 # define SOAP_SOURCE_STAMP(str) 110 #endif 111 112 /* gSOAP 2.7.4 and higher: fast look-aside buffering is stable */ 113 #ifndef WITH_FAST 114 # define WITH_FAST 115 #endif 116 117 #ifdef WITH_LEANER 118 # ifndef WITH_LEAN 119 # define WITH_LEAN 120 # endif 121 #endif 122 123 #ifdef WITH_LEAN 124 # ifdef WITH_COOKIES 125 # error "Cannot build WITH_LEAN code WITH_COOKIES enabled" 126 # endif 127 #endif 128 129 #ifndef STDSOAP_H 130 #define STDSOAP_H 131 132 #if defined(__vxworks) || defined(__VXWORKS__) 133 # define VXWORKS 134 #endif 135 136 #ifdef _WIN32 137 # ifndef WIN32 138 # define WIN32 139 # endif 140 #endif 141 142 #ifdef _WIN32_WCE 143 # ifndef UNDER_CE 144 # define UNDER_CE _WIN32_WCE 145 # endif 146 #endif 147 148 #ifdef UNDER_CE 149 # ifndef WIN32 150 # define WIN32 151 # endif 152 #endif 153 154 #ifdef __BORLANDC__ 155 # ifdef __WIN32__ 156 # ifndef WIN32 157 # define WIN32 158 # endif 159 # endif 160 #endif 161 162 #ifdef __CYGWIN__ 163 # ifndef CYGWIN 164 # define CYGWIN 165 # endif 166 #endif 167 168 #ifdef __SYMBIAN32__ 169 # define SYMBIAN 170 # undef WIN32 171 #endif 172 173 #if defined(__palmos__) || defined(PALM_GCC) || defined(__PALMOS_TRAPS__) 174 # ifndef PALM 175 # define PALM 176 # endif 177 #endif 178 179 #if defined(__hpux) 180 # ifndef HP_UX 181 # define HP_UX 182 # endif 183 #endif 184 185 #if defined(__digital__) && defined(__unix__) 186 # ifndef TRU64 187 # define TRU64 188 # endif 189 #endif 190 191 #ifdef __MVS__ 192 # ifndef OS390 193 # define OS390 194 # endif 195 #endif 196 197 #ifdef HAVE_CONFIG_H 198 # include "config.h" 199 # if defined(WITH_OPENSSL) 200 # ifndef HAVE_OPENSSL_SSL_H 201 # undef WITH_OPENSSL 202 # endif 203 # endif 204 # if defined(WITH_ZLIB) || defined(WITH_GZIP) 205 # ifndef HAVE_ZLIB_H 206 # undef WITH_ZLIB 207 # undef WITH_GZIP 208 # endif 209 # endif 210 #else 211 # if defined(UNDER_CE) 212 # define WITH_LEAN 213 # define HAVE_SSCANF 214 # elif defined(WIN32) 215 # define HAVE_STRRCHR 216 # define HAVE_STRTOD 217 # define HAVE_SSCANF 218 # define HAVE_STRTOL 219 # define HAVE_STRTOUL 220 # define HAVE_SYS_TIMEB_H 221 # define HAVE_FTIME 222 # define HAVE_WCTOMB 223 # define HAVE_MBTOWC 224 # define SOAP_LONG_FORMAT "%I64d" 225 # define SOAP_ULONG_FORMAT "%I64u" 226 # elif defined(CYGWIN) 227 # define HAVE_STRRCHR 228 # define HAVE_STRTOD 229 # define HAVE_SSCANF 230 # define HAVE_STRTOL 231 # define HAVE_STRTOUL 232 # define HAVE_SYS_TIMEB_H 233 # define HAVE_FTIME 234 # define HAVE_RAND_R 235 # define HAVE_GMTIME_R 236 # define HAVE_LOCALTIME_R 237 # define HAVE_WCTOMB 238 # define HAVE_MBTOWC 239 # elif defined(__APPLE__) 240 # define HAVE_STRRCHR 241 # define HAVE_STRTOD 242 # define HAVE_SSCANF 243 # define HAVE_STRTOD_L 244 # define HAVE_SSCANF_L 245 # define HAVE_SPRINTF_L 246 # define HAVE_STRTOL 247 # define HAVE_STRTOUL 248 # define HAVE_RAND_R 249 # define HAVE_GMTIME_R 250 # define HAVE_LOCALTIME_R 251 # define HAVE_TIMEGM 252 # define HAVE_WCTOMB 253 # define HAVE_MBTOWC 254 # elif defined(_AIX43) 255 # define HAVE_STRRCHR 256 # define HAVE_STRTOD 257 # define HAVE_SSCANF 258 # define HAVE_STRTOL 259 # define HAVE_STRTOUL 260 # define HAVE_SYS_TIMEB_H 261 # define HAVE_FTIME 262 # define HAVE_RAND_R 263 # define HAVE_GMTIME_R 264 # define HAVE_LOCALTIME_R 265 # define HAVE_WCTOMB 266 # define HAVE_MBTOWC 267 # elif defined(_AIX41) 268 # define HAVE_STRRCHR 269 # define HAVE_STRTOD 270 # define HAVE_SSCANF 271 # define HAVE_STRTOL 272 # define HAVE_STRTOUL 273 # define HAVE_SYS_TIMEB_H 274 # define HAVE_WCTOMB 275 # define HAVE_MBTOWC 276 # elif defined(HP_UX) 277 # define HAVE_STRRCHR 278 # define HAVE_STRTOD 279 # define HAVE_SSCANF 280 # define HAVE_STRTOL 281 # define HAVE_STRTOUL 282 # define HAVE_SYS_TIMEB_H 283 # define HAVE_FTIME 284 # define HAVE_RAND_R 285 # define HAVE_GMTIME_R 286 # define HAVE_LOCALTIME_R 287 # define HAVE_WCTOMB 288 # define HAVE_MBTOWC 289 # elif defined(FREEBSD) || defined(__FreeBSD__) 290 # define HAVE_STRRCHR 291 # define HAVE_STRTOD 292 # define HAVE_SSCANF 293 # define HAVE_STRTOD_L 294 # define HAVE_SSCANF_L 295 # define HAVE_SPRINTF_L 296 # define HAVE_STRTOL 297 # define HAVE_STRTOUL 298 # define HAVE_STRTOLL 299 # define HAVE_STRTOULL 300 # define HAVE_GETTIMEOFDAY 301 # define HAVE_RAND_R 302 # define HAVE_GMTIME_R 303 # define HAVE_LOCALTIME_R 304 # define HAVE_WCTOMB 305 # define HAVE_MBTOWC 306 # define SOAP_LONG_FORMAT "%qd" 307 # define SOAP_ULONG_FORMAT "%qu" 308 # elif defined(__VMS) 309 # define HAVE_STRRCHR 310 # define HAVE_STRTOD 311 # define HAVE_SSCANF 312 # define HAVE_STRTOL 313 # define HAVE_STRTOUL 314 # define HAVE_SYS_TIMEB_H 315 # define HAVE_FTIME 316 # define HAVE_RAND_R 317 # define HAVE_GMTIME_R 318 # define HAVE_LOCALTIME_R 319 # define HAVE_WCTOMB 320 # define HAVE_MBTOWC 321 # elif defined(__GLIBC__) || defined(__GNU__) 322 # define HAVE_STRRCHR 323 # define HAVE_STRTOD 324 # define HAVE_SSCANF 325 # define HAVE_STRTOD_L 326 # define HAVE_SSCANF_L 327 # define HAVE_SPRINTF_L 328 # define HAVE_STRTOL 329 # define HAVE_STRTOUL 330 # define HAVE_STRTOLL 331 # define HAVE_STRTOULL 332 # define HAVE_SYS_TIMEB_H 333 # define HAVE_FTIME 334 # define HAVE_RAND_R 335 # define HAVE_GMTIME_R 336 # define HAVE_LOCALTIME_R 337 # define HAVE_TIMEGM 338 # define HAVE_WCTOMB 339 # define HAVE_MBTOWC 340 # define HAVE_ISNAN 341 # elif defined(TRU64) 342 # define HAVE_STRRCHR 343 # define HAVE_STRTOD 344 # define HAVE_SSCANF 345 # define HAVE_STRTOL 346 # define HAVE_STRTOUL 347 # define HAVE_GETTIMEOFDAY 348 # define HAVE_SYS_TIMEB_H 349 # define HAVE_RAND_R 350 # define HAVE_GMTIME_R 351 # define HAVE_LOCALTIME_R 352 # define __USE_STD_IOSTREAM 353 # define HAVE_WCTOMB 354 # define HAVE_MBTOWC 355 # define SOAP_LONG_FORMAT "%ld" 356 # define SOAP_ULONG_FORMAT "%lu" 357 # elif defined(MAC_CARBON) 358 # define WITH_NOIO 359 # define HAVE_STRRCHR 360 # define HAVE_STRTOD 361 # define HAVE_SSCANF 362 # define HAVE_STRTOD_L 363 # define HAVE_SSCANF_L 364 # define HAVE_SPRINTF_L 365 # define HAVE_STRTOL 366 # define HAVE_STRTOUL 367 # define HAVE_FTIME 368 # define HAVE_RAND_R 369 # define HAVE_GETHOSTBYNAME_R 370 # define HAVE_GMTIME_R 371 # define HAVE_LOCALTIME_R 372 # define HAVE_WCTOMB 373 # define HAVE_MBTOWC 374 # elif defined(PALM) 375 # define WITH_LEAN 376 # define HAVE_STRTOD /* strtod() is defined in palmFunctions.h */ 377 # include <stdlib.h> /* Needs to be included before unix headers */ 378 # include <sys_types.h> 379 # define IGNORE_STDIO_STUBS 380 # include <StdIOPalm.h> 381 # define O_NONBLOCK FNONBIO 382 # include <sys_socket.h> 383 # include "palmFunctions.h" 384 # elif defined(SYMBIAN) 385 # define WITH_LEAN 386 # define WITH_NONAMESPACES 387 # define HAVE_STRTOD /* use STRTOD since sscanf doesn't seem to work */ 388 # include <e32def.h> 389 # include <sys/ioctl.h> 390 # elif defined(VXWORKS) 391 # ifdef _WRS_KERNEL 392 # define _POSIX_THREADS 1 393 # endif 394 # define HAVE_STRRCHR 395 # define HAVE_STRTOD 396 # define HAVE_SSCANF 397 # define HAVE_STRTOL 398 # define HAVE_STRTOUL 399 # define HAVE_GMTIME 400 # define HAVE_LOCALTIME 401 # define HAVE_MKTIME 402 # elif defined(OS390) 403 # define HAVE_STRRCHR 404 # define HAVE_STRTOD 405 # define HAVE_SSCANF 406 # define HAVE_STRTOL 407 # define HAVE_STRTOUL 408 # define HAVE_SYS_TIMEB_H 409 # define HAVE_FTIME 410 # define HAVE_RAND_R 411 # define HAVE_GMTIME_R 412 # define HAVE_LOCALTIME_R 413 # define HAVE_WCTOMB 414 # define HAVE_MBTOWC 415 # elif defined(AS400) 416 # define HAVE_STRRCHR 417 # define HAVE_STRTOD 418 # define HAVE_SSCANF 419 # define HAVE_STRTOL 420 # define HAVE_STRTOUL 421 # define HAVE_SYS_TIMEB_H 422 # define HAVE_FTIME 423 # define HAVE_RAND_R 424 # define HAVE_GMTIME_R 425 # define HAVE_LOCALTIME_R 426 # define HAVE_WCTOMB 427 # define HAVE_MBTOWC 428 # elif defined(__QNX__) || defined(QNX) 429 /* QNX does not have a working version of strtof */ 430 # undef HAVE_STRTOF 431 # define HAVE_STRRCHR 432 # define HAVE_STRTOD 433 # define HAVE_SSCANF 434 # define HAVE_STRTOL 435 # define HAVE_STRTOUL 436 # define HAVE_SYS_TIMEB_H 437 # define HAVE_FTIME 438 # define HAVE_RAND_R 439 # define HAVE_GETHOSTBYNAME_R 440 # define HAVE_GMTIME_R 441 # define HAVE_LOCALTIME_R 442 # define HAVE_WCTOMB 443 # define HAVE_MBTOWC 444 # define LONG64 long 445 # define ULONG64 unsigned LONG64 446 # define SOAP_LONG_FORMAT "%ld" 447 # define SOAP_ULONG_FORMAT "%lu" 448 # else 449 /* Default asumptions on supported functions */ 450 # define HAVE_STRRCHR 451 # define HAVE_STRTOD 452 # define HAVE_SSCANF 453 # define HAVE_STRTOL 454 # define HAVE_STRTOUL 455 # define HAVE_SYS_TIMEB_H 456 # define HAVE_FTIME 457 # define HAVE_RAND_R 458 # define HAVE_GETHOSTBYNAME_R 459 # define HAVE_GMTIME_R 460 # define HAVE_LOCALTIME_R 461 # define HAVE_WCTOMB 462 # define HAVE_MBTOWC 463 # endif 464 #endif 465 466 /* native Win and HP-UX compilers don't like empty structs */ 467 #if defined(WIN32) || defined(HP_UX) 468 # define WITH_NOEMPTYSTRUCT 469 #endif 470 471 #ifdef HP_UX 472 # undef HAVE_STRTOLL 473 # undef HAVE_STRTOULL 474 #endif 475 476 #ifdef WITH_C_LOCALE 477 # include <xlocale.h> 478 #else 479 # undef HAVE_STRTOF_L 480 # undef HAVE_STRTOD_L 481 # undef HAVE_SSCANF_L 482 # undef HAVE_SPRINTF_L 483 #endif 484 485 #ifndef WITH_NOSTDLIB 486 # include <stdlib.h> 487 # ifndef PALM 488 # include <stdio.h> 489 # include <string.h> 490 # endif 491 # include <ctype.h> 492 # include <limits.h> 493 #endif 494 495 #if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT) 496 # include <string> 497 # include <iostream> 498 #endif 499 500 #ifdef WITH_NOHTTP 501 # ifndef WITH_NOIO 502 # define WITH_NOIO 503 # undef WITH_COOKIES 504 # endif 505 #endif 506 507 /* Suggestion when SOAP_FD_EXCEEDED error occurs: 508 Some systems allow increasing FD_SETSIZE before including sys/types.h: 509 #define FD_SETSIZE (2048) 510 */ 511 512 #ifndef UNDER_CE 513 # ifndef PALM 514 # ifndef WITH_NOIO 515 # include <errno.h> 516 # include <sys/types.h> 517 # endif 518 # ifndef WITH_LEAN 519 # ifdef HAVE_SYS_TIMEB_H 520 # include <sys/timeb.h> /* for ftime() */ 521 # endif 522 # include <time.h> 523 # endif 524 # endif 525 #endif 526 527 #ifdef OPENSERVER 528 # include <sys/socket.h> 529 # include <sys/stream.h> 530 # include <sys/protosw.h> 531 extern int h_errno; 532 #endif 533 534 #ifndef WITH_NOIO 535 # ifndef WIN32 536 # ifndef PALM 537 # include <sys/socket.h> 538 # ifdef VXWORKS 539 # include <sockLib.h> 540 # include <selectLib.h> 541 # ifndef _WRS_KERNEL 542 # include <strings.h> 543 # endif 544 # else 545 # ifndef SYMBIAN 546 # include <strings.h> 547 # endif 548 # endif 549 # ifdef SUN_OS 550 # include <sys/stream.h> /* SUN */ 551 # include <sys/socketvar.h> /* SUN < 2.8 (?) */ 552 # endif 553 # ifdef VXWORKS 554 # ifdef _WRS_KERNEL 555 # include <sys/times.h> 556 # endif 557 # else 558 # include <sys/time.h> 559 # endif 560 # include <netinet/in.h> 561 # ifdef OS390 562 # include <netinet/tcp_var.h> 563 # else 564 # include <netinet/tcp.h> /* TCP_NODELAY */ 565 # endif 566 # include <arpa/inet.h> 567 # endif 568 # endif 569 #endif 570 571 #ifdef WIN32 572 # define SOAP_WINSOCKINT int 573 #else 574 # define SOAP_WINSOCKINT size_t 575 #endif 576 577 #ifdef WIN32 578 # ifndef UNDER_CE 579 # include <io.h> 580 # include <fcntl.h> 581 # endif 582 # ifdef WITH_IPV6 583 # include <winsock2.h> /* Visual Studio 2005 users: you must install the Platform SDK (R2) */ 584 # include <ws2tcpip.h> 585 # include <wspiapi.h> 586 # define SOAP_GAI_STRERROR gai_strerrorA 587 # else 588 # include <winsock.h> /* Visual Studio 2005 users: you must install the Platform SDK (R2) */ 589 /* # include <winsock2.h> */ /* Alternative: use winsock2 (not available with eVC) */ 590 # endif 591 #else 592 # ifdef VXWORKS 593 # include <hostLib.h> 594 # include <ioctl.h> 595 # include <ioLib.h> 596 # endif 597 # ifndef WITH_NOIO 598 # ifndef PALM 599 # include <netdb.h> 600 # include <netinet/in.h> 601 # include <unistd.h> 602 # include <fcntl.h> 603 # ifdef _AIX41 604 # include <sys/select.h> 605 # endif 606 # endif 607 # endif 608 #endif 609 610 #ifdef WITH_FASTCGI 611 # include <fcgi_stdio.h> 612 #endif 613 614 #ifdef WITH_OPENSSL 615 # define OPENSSL_NO_KRB5 616 # include <openssl/bio.h> 617 # include <openssl/err.h> 618 # include <openssl/rand.h> 619 # include <openssl/ssl.h> 620 # include <openssl/x509v3.h> 621 # ifndef ALLOW_OLD_VERSIONS 622 # if (OPENSSL_VERSION_NUMBER < 0x00905100L) 623 # error "Must use OpenSSL 0.9.6 or later" 624 # endif 625 # endif 626 #endif 627 628 #ifdef WITH_GZIP 629 # ifndef WITH_ZLIB 630 # define WITH_ZLIB 631 # endif 632 #endif 633 634 #ifdef WITH_CASEINSENSITIVETAGS 635 # define SOAP_STRCMP soap_tag_cmp /* case insensitve XML element/attribute names */ 636 #else 637 # define SOAP_STRCMP strcmp /* case sensitive XML element/attribute names */ 638 #endif 639 640 #ifdef WITH_ZLIB 641 # include <zlib.h> 642 #endif 643 644 #ifndef WITH_NOSTDLIB 645 # ifndef PALM 646 # include <math.h> /* for isnan() */ 647 # endif 648 #endif 649 650 /* #define DEBUG */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and messages (in file TEST.log) */ 651 652 #ifdef __cplusplus 653 extern "C" { 654 #endif 655 656 /* Portability: define SOAP_SOCKLEN_T */ 657 #if defined(_AIX) 658 # if defined(_AIX43) 659 # define SOAP_SOCKLEN_T socklen_t 660 # else 661 # define SOAP_SOCKLEN_T int 662 # endif 663 #elif defined(SOCKLEN_T) 664 # define SOAP_SOCKLEN_T SOCKLEN_T 665 #elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN) || defined(FREEBSD) || defined(__FreeBSD__) || defined(__QNX__) || defined(QNX) || defined(OS390) 666 # define SOAP_SOCKLEN_T socklen_t 667 #elif defined(IRIX) || defined(WIN32) || defined(__APPLE__) || defined(HP_UX) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS) 668 # define SOAP_SOCKLEN_T int 669 #else 670 # define SOAP_SOCKLEN_T size_t 671 #endif 672 673 #ifndef SOAP_SOCKET 674 # ifdef WIN32 675 # define SOAP_SOCKET SOCKET 676 # define soap_closesocket(n) closesocket(n) 677 # else 678 # define SOAP_SOCKET int 679 # define soap_closesocket(n) close(n) 680 # endif 681 #endif 682 683 #define SOAP_INVALID_SOCKET ((SOAP_SOCKET)-1) 684 #define soap_valid_socket(n) ((n) != SOAP_INVALID_SOCKET) 685 686 #ifndef SOAP_GAI_STRERROR 687 # define SOAP_GAI_STRERROR gai_strerror 688 #endif 689 690 #ifndef FD_SETSIZE 691 # define FD_SETSIZE (1024) 692 #endif 693 694 #if defined(SYMBIAN) 695 # define LONG64 long 696 # define ULONG64 unsigned LONG64 697 #elif !defined(WIN32) || defined(CYGWIN) || defined(__GLIBC__) || defined(__GNU__) 698 # ifndef LONG64 699 # if defined(HAVE_STDINT_H) 700 # include <stdint.h> 701 # define LONG64 int64_t 702 # define ULONG64 uint64_t 703 # elif defined(__GLIBC__) 704 # include <bits/wordsize.h> 705 # if (__WORDSIZE == 64) 706 # define LONG64 int64_t 707 # define ULONG64 uint64_t 708 # ifndef SOAP_LONG_FORMAT 709 # define SOAP_LONG_FORMAT "%ld" 710 # endif 711 # ifndef SOAP_ULONG_FORMAT 712 # define SOAP_ULONG_FORMAT "%lu" 713 # endif 714 # else 715 # define LONG64 long long 716 # define ULONG64 unsigned LONG64 717 # endif 718 # else 719 # define LONG64 long long 720 # define ULONG64 unsigned LONG64 721 # endif 722 # endif 723 #elif defined(UNDER_CE) 724 # define LONG64 __int64 725 # define ULONG64 unsigned LONG64 726 #elif defined(__BORLANDC__) 727 # define LONG64 __int64 728 # define ULONG64 unsigned LONG64 729 #endif 730 731 #ifndef SOAP_LONG_FORMAT 732 # define SOAP_LONG_FORMAT "%lld" /* printf format for 64 bit ints */ 733 #endif 734 735 #ifndef SOAP_ULONG_FORMAT 736 # define SOAP_ULONG_FORMAT "%llu" /* printf format for unsigned 64 bit ints */ 737 #endif 738 739 #if defined(WIN32) && !defined(CYGWIN) 740 # define soap_int32 __int32 741 #elif defined(SYMBIAN) 742 # define soap_int32 long 743 #elif defined(PALM) 744 # define soap_int32 Int32 745 #elif defined(_AIX) 746 # if defined(_AIX43) 747 # define soap_int32 int32_t 748 # else 749 # define soap_int32 signed int 750 # endif 751 #else 752 # define soap_int32 int32_t 753 #endif 754 755 #ifdef WIN32 756 # define SOAP_ERANGE ERANGE 757 # define SOAP_EINTR WSAEINTR 758 # define SOAP_EAGAIN WSAEWOULDBLOCK 759 # define SOAP_EWOULDBLOCK WSAEWOULDBLOCK 760 # define SOAP_EINPROGRESS WSAEINPROGRESS 761 # define SOAP_EADDRINUSE WSAEADDRINUSE 762 #else 763 # define SOAP_ERANGE ERANGE 764 # define SOAP_EINTR EINTR 765 # define SOAP_EAGAIN EAGAIN 766 # define SOAP_EADDRINUSE EADDRINUSE 767 # ifdef SYMBIAN 768 # define SOAP_EWOULDBLOCK 9898 769 # define SOAP_EINPROGRESS 9899 770 # else 771 # define SOAP_EWOULDBLOCK EWOULDBLOCK 772 # define SOAP_EINPROGRESS EINPROGRESS 773 # endif 774 #endif 775 776 #ifdef WIN32 777 # ifdef UNDER_CE 778 # define soap_errno GetLastError() 779 # define soap_socket_errno(s) GetLastError() 780 # define soap_reset_errno SetLastError(0) 781 # else 782 # define soap_errno GetLastError() 783 # define soap_socket_errno(s) WSAGetLastError() 784 # define soap_reset_errno SetLastError(0) 785 # endif 786 #else 787 # ifndef WITH_NOIO 788 # define soap_errno errno 789 # define soap_socket_errno(s) errno 790 # define soap_reset_errno (errno = 0) 791 # else 792 # define soap_errno 0 793 # define soap_socket_errno(s) 0 794 # define soap_reset_errno 795 # endif 796 #endif 797 798 #ifndef SOAP_BUFLEN 799 # ifndef WITH_LEAN 800 # define SOAP_BUFLEN (65536) /* buffer length for socket packets, also used by gethostbyname_r and UDP messages, so don't make this too small */ 801 # else 802 # define SOAP_BUFLEN (2048) 803 # endif 804 #endif 805 #ifndef SOAP_LABLEN 806 # define SOAP_LABLEN (256) /* initial look-aside buffer length */ 807 #endif 808 #ifndef SOAP_PTRBLK 809 # define SOAP_PTRBLK (32) /* block allocation for pointer hash table chains */ 810 #endif 811 #ifndef SOAP_PTRHASH 812 # ifndef WITH_LEAN 813 # define SOAP_PTRHASH (1024) /* size of pointer analysis hash table (must be power of 2) */ 814 # else 815 # define SOAP_PTRHASH (32) 816 # endif 817 #endif 818 #ifndef SOAP_IDHASH 819 # ifndef WITH_LEAN 820 # define SOAP_IDHASH (1999) /* prime size of hash table for parsed id/ref */ 821 # else 822 # define SOAP_IDHASH (19) /* 19, 199 */ 823 # endif 824 #endif 825 #ifndef SOAP_BLKLEN 826 # ifndef WITH_LEAN 827 # define SOAP_BLKLEN (256) /* size of blocks to collect long strings and XML attributes */ 828 # else 829 # define SOAP_BLKLEN (32) 830 # endif 831 #endif 832 #ifndef SOAP_TAGLEN 833 # ifndef WITH_LEAN 834 # define SOAP_TAGLEN (1024) /* maximum length of XML element tag/attribute name or host/path name + 1 */ 835 # else 836 # define SOAP_TAGLEN (64) 837 # endif 838 #endif 839 #ifndef SOAP_HDRLEN 840 # ifndef WITH_LEAN 841 # define SOAP_HDRLEN (8192) /* maximum length of HTTP header line (must be >4096 to read cookies) */ 842 # else 843 # define SOAP_HDRLEN (1024) 844 # endif 845 #endif 846 #ifndef SOAP_MAXDIMS 847 # ifndef WITH_LEAN 848 # define SOAP_MAXDIMS (16) /* maximum array dimensions (array nestings) must be less than 64 to protect soap->tmpbuf */ 849 # else 850 # define SOAP_MAXDIMS (4) 851 # endif 852 #endif 853 854 #ifndef SOAP_MAXLOGS 855 # define SOAP_MAXLOGS (3) /* max number of debug logs per struct soap environment */ 856 # define SOAP_INDEX_RECV (0) 857 # define SOAP_INDEX_SENT (1) 858 # define SOAP_INDEX_TEST (2) 859 #endif 860 861 /* Max iterations in soap_serve() to keep server connection alive */ 862 #ifndef SOAP_MAXKEEPALIVE 863 # define SOAP_MAXKEEPALIVE (100) 864 #endif 865 866 /* Trusted max size of inbound SOAP array for compound array allocation. 867 Increase if necessary to allow larger arrays. 868 */ 869 #ifndef SOAP_MAXARRAYSIZE 870 # define SOAP_MAXARRAYSIZE (1000000) 871 #endif 872 873 #ifdef VXWORKS 874 # ifdef __INCmathh 875 # include <private/mathP.h> 876 # ifndef HAVE_ISNAN 877 # define HAVE_ISNAN 878 # endif 879 # define soap_isnan(num) isNan(num) 880 # endif 881 #endif 882 883 #ifdef WIN32 884 # include <float.h> 885 # ifndef HAVE_ISNAN 886 # define HAVE_ISNAN 887 # endif 888 # define soap_isnan(num) _isnan(num) 889 #endif 890 891 #ifdef SUN_OS 892 # define HAVE_ISNAN 893 #endif 894 895 #ifdef __APPLE__ 896 # ifdef __cplusplus 897 # ifndef isnan 898 extern "C" int isnan(double); 899 # endif 900 # endif 901 # define HAVE_ISNAN 902 #endif 903 904 #if !defined(HAVE_ISNAN) && (defined(_MATH_H) || defined(_MATH_INCLUDED)) 905 # define HAVE_ISNAN 906 #endif 907 908 extern const struct soap_double_nan { unsigned int n1, n2; } soap_double_nan; 909 910 #ifdef VXWORKS 911 # ifndef FLT_MAX 912 # define FLT_MAX _ARCH_FLT_MAX 913 # endif 914 # ifndef DBL_MAX 915 # define DBL_MAX _ARCH_DBL_MAX 916 # endif 917 #endif 918 919 #ifndef FLT_NAN 920 # define FLT_NAN (*(float*)(void*)&soap_double_nan) 921 #endif 922 923 #ifndef FLT_PINFTY 924 # if defined(FLT_MAX) 925 # define FLT_PINFTY FLT_MAX 926 # elif defined(HUGE_VALF) 927 # define FLT_PINFTY (float)HUGE_VALF 928 # elif defined(HUGE_VAL) 929 # define FLT_PINFTY (float)HUGE_VAL 930 # elif defined(FLOAT_MAX) 931 # define FLT_PINFTY FLOAT_MAX 932 # else 933 # define FLT_PINFTY (3.40282347e+38F) 934 # endif 935 #endif 936 937 #ifndef FLT_NINFTY 938 # define FLT_NINFTY (-FLT_PINFTY) 939 #endif 940 941 #ifndef DBL_NAN 942 # define DBL_NAN (*(double*)(void*)&soap_double_nan) 943 #endif 944 945 #ifndef DBL_PINFTY 946 # if defined(DBL_MAX) 947 # define DBL_PINFTY DBL_MAX 948 # elif defined(HUGE_VALF) 949 # define DBL_PINFTY (double)HUGE_VALF 950 # elif defined(HUGE_VAL) 951 # define DBL_PINFTY (double)HUGE_VAL 952 # elif defined(DOUBLE_MAX) 953 # define DBL_PINFTY DOUBLE_MAX 954 # else 955 # define DBL_PINFTY (1.7976931348623157e+308) 956 # endif 957 #endif 958 959 #ifndef DBL_NINFTY 960 # define DBL_NINFTY (-DBL_PINFTY) 961 #endif 962 963 #ifndef soap_isnan 964 # ifdef HAVE_ISNAN 965 # define soap_isnan(n) isnan(n) 966 # else 967 # define soap_isnan(n) (0) 968 # endif 969 #endif 970 971 #define soap_ispinfd(n) ((n) >= DBL_PINFTY) 972 #define soap_ispinff(n) ((n) >= FLT_PINFTY) 973 #define soap_isninfd(n) ((n) <= DBL_NINFTY) 974 #define soap_isninff(n) ((n) <= FLT_NINFTY) 975 976 /* gSOAP error codes */ 977 978 #define SOAP_EOF EOF 979 #define SOAP_ERR EOF 980 #define SOAP_OK 0 981 #define SOAP_CLI_FAULT 1 982 #define SOAP_SVR_FAULT 2 983 #define SOAP_TAG_MISMATCH 3 984 #define SOAP_TYPE 4 985 #define SOAP_SYNTAX_ERROR 5 986 #define SOAP_NO_TAG 6 987 #define SOAP_IOB 7 988 #define SOAP_MUSTUNDERSTAND 8 989 #define SOAP_NAMESPACE 9 990 #define SOAP_USER_ERROR 10 991 #define SOAP_FATAL_ERROR 11 992 #define SOAP_FAULT 12 993 #define SOAP_NO_METHOD 13 994 #define SOAP_NO_DATA 14 995 #define SOAP_GET_METHOD 15 996 #define SOAP_PUT_METHOD 16 997 #define SOAP_DEL_METHOD 17 998 #define SOAP_HEAD_METHOD 18 999 #define SOAP_HTTP_METHOD 19 1000 #define SOAP_EOM 20 1001 #define SOAP_MOE 21 1002 #define SOAP_HDR 22 1003 #define SOAP_NULL 23 1004 #define SOAP_DUPLICATE_ID 24 1005 #define SOAP_MISSING_ID 25 1006 #define SOAP_HREF 26 1007 #define SOAP_UDP_ERROR 27 1008 #define SOAP_TCP_ERROR 28 1009 #define SOAP_HTTP_ERROR 29 1010 #define SOAP_SSL_ERROR 30 1011 #define SOAP_ZLIB_ERROR 31 1012 #define SOAP_DIME_ERROR 32 1013 #define SOAP_DIME_HREF 33 1014 #define SOAP_DIME_MISMATCH 34 1015 #define SOAP_DIME_END 35 1016 #define SOAP_MIME_ERROR 36 1017 #define SOAP_MIME_HREF 37 1018 #define SOAP_MIME_END 38 1019 #define SOAP_VERSIONMISMATCH 39 1020 #define SOAP_PLUGIN_ERROR 40 1021 #define SOAP_DATAENCODINGUNKNOWN 41 1022 #define SOAP_REQUIRED 42 1023 #define SOAP_PROHIBITED 43 1024 #define SOAP_OCCURS 44 1025 #define SOAP_LENGTH 45 1026 #define SOAP_FD_EXCEEDED 46 1027 1028 #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) 1029 #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) 1030 #define soap_tcp_error_check(e) ((e) == SOAP_EOF || (e) == SOAP_TCP_ERROR) 1031 #define soap_ssl_error_check(e) ((e) == SOAP_SSL_ERROR) 1032 #define soap_zlib_error_check(e) ((e) == SOAP_ZLIB_ERROR) 1033 #define soap_http_error_check(e) ((e) == SOAP_HTTP_ERROR || ((e) >= SOAP_GET_METHOD && (e) <= SOAP_HTTP_METHOD)|| (e) == SOAP_NO_DATA || ((e) >= 100 && (e) < 600)) 1034 1035 /* gSOAP HTTP response status codes 100 to 599 are reserved */ 1036 1037 /* Codes 600 to 999 are user definable */ 1038 1039 /* Exceptional gSOAP HTTP response status codes >= 1000 */ 1040 1041 #define SOAP_STOP 1000 /* No HTTP response */ 1042 #define SOAP_FORM 1001 /* Form request/response */ 1043 #define SOAP_HTML 1002 /* Custom HTML response */ 1044 #define SOAP_FILE 1003 /* Custom file-based response */ 1045 1046 /* gSOAP HTTP method codes */ 1047 1048 #define SOAP_POST 2000 1049 #define SOAP_GET 2001 1050 1051 /* gSOAP DIME */ 1052 1053 #define SOAP_DIME_CF 0x01 1054 #define SOAP_DIME_ME 0x02 1055 #define SOAP_DIME_MB 0x04 1056 #define SOAP_DIME_VERSION 0x08 /* DIME version 1 */ 1057 #define SOAP_DIME_MEDIA 0x10 1058 #define SOAP_DIME_ABSURI 0x20 1059 1060 /* gSOAP ZLIB */ 1061 1062 #define SOAP_ZLIB_NONE 0x00 1063 #define SOAP_ZLIB_DEFLATE 0x01 1064 #define SOAP_ZLIB_INFLATE 0x02 1065 #define SOAP_ZLIB_GZIP 0x02 1066 1067 /* gSOAP transport, connection, and content encoding modes */ 1068 1069 typedef soap_int32 soap_mode; 1070 1071 #define SOAP_IO 0x00000003 /* IO mask */ 1072 #define SOAP_IO_FLUSH 0x00000000 /* flush output immediately, no buffering */ 1073 #define SOAP_IO_BUFFER 0x00000001 /* buffer output in packets of size SOAP_BUFLEN */ 1074 #define SOAP_IO_STORE 0x00000002 /* store entire output to determine length for transport */ 1075 #define SOAP_IO_CHUNK 0x00000003 /* use HTTP chunked transfer AND buffer packets */ 1076 1077 #define SOAP_IO_UDP 0x00000004 /* TCP or UDP */ 1078 1079 #define SOAP_IO_LENGTH 0x00000008 /* calc message length (internal) */ 1080 #define SOAP_IO_KEEPALIVE 0x00000010 /* keep connection alive */ 1081 1082 #define SOAP_ENC_LATIN 0x00000020 /* accept iso-8859-1 encoding */ 1083 #define SOAP_ENC_XML 0x00000040 /* plain XML encoding, no HTTP header */ 1084 #define SOAP_ENC_DIME 0x00000080 1085 #define SOAP_ENC_MIME 0x00000100 1086 #define SOAP_ENC_MTOM 0x00000200 1087 #define SOAP_ENC_ZLIB 0x00000400 1088 #define SOAP_ENC_SSL 0x00000800 1089 1090 #define SOAP_ENC 0x00000FFF /* IO and ENC mask */ 1091 1092 #define SOAP_XML_STRICT 0x00001000 /* apply strict validation */ 1093 #define SOAP_XML_INDENT 0x00002000 /* emit indented XML */ 1094 #define SOAP_XML_CANONICAL 0x00004000 /* EXC C14N canonical XML */ 1095 #define SOAP_XML_TREE 0x00008000 /* emit XML tree (no id/ref) */ 1096 #define SOAP_XML_GRAPH 0x00010000 1097 #define SOAP_XML_NIL 0x00020000 1098 #define SOAP_XML_DOM 0x00040000 1099 #define SOAP_XML_SEC 0x00080000 /* reserved for WS security */ 1100 1101 #define SOAP_C_NOIOB 0x00100000 /* don't fault on array index out of bounds (just ignore) */ 1102 #define SOAP_C_UTFSTRING 0x00200000 /* (de)serialize strings with UTF8 content */ 1103 #define SOAP_C_MBSTRING 0x00400000 /* (de)serialize strings with multi-byte content */ 1104 #define SOAP_C_NILSTRING 0x00800000 /* serialize empty strings as nil (omitted) */ 1105 1106 #define SOAP_DOM_TREE 0x01000000 1107 #define SOAP_DOM_NODE 0x02000000 1108 #define SOAP_DOM_ASIS 0x04000000 1109 1110 #define SOAP_MIME_POSTCHECK 0x10000000 /* MIME flag (internal) */ 1111 1112 #define SOAP_IO_DEFAULT SOAP_IO_FLUSH 1113 1114 /* SSL client/server authentication settings */ 1115 1116 #define SOAP_SSL_NO_AUTHENTICATION 0x00 /* for testing purposes */ 1117 #define SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION 0x01 /* client requires server to authenticate */ 1118 #define SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION 0x02 /* server requires client to authenticate */ 1119 #define SOAP_SSL_SKIP_HOST_CHECK 0x04 /* client does not check the common name of the host in certificate */ 1120 #define SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE 0x08 /* client does not check the expiration date of the host certificate */ 1121 #define SOAP_SSL_NO_DEFAULT_CA_PATH 0x10 /* don't use default_verify_paths */ 1122 #define SOAP_SSL_RSA 0x20 /* use RSA */ 1123 #define SOAP_SSLv3 0x40 /* SSL v3 only */ 1124 #define SOAP_TLSv1 0x80 /* TLS v1 only */ 1125 #define SOAP_SSLv3_TLSv1 0x00 /* SSL v3 and TLS v1 support by default */ 1126 1127 #define SOAP_SSL_DEFAULT (SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION | SOAP_SSLv3_TLSv1) 1128 1129 /* state */ 1130 1131 #define SOAP_NONE 0 1132 #define SOAP_INIT 1 1133 #define SOAP_COPY 2 1134 1135 #define soap_check_state(soap) (!(soap) || ((soap)->state != SOAP_INIT && (soap)->state != SOAP_COPY)) 1136 1137 /* part */ 1138 1139 #define SOAP_BEGIN 0 1140 #define SOAP_IN_ENVELOPE 2 1141 #define SOAP_IN_HEADER 3 1142 #define SOAP_END_HEADER 4 1143 #define SOAP_NO_BODY 5 1144 #define SOAP_IN_BODY 6 1145 #define SOAP_END_BODY 7 1146 #define SOAP_END_ENVELOPE 8 1147 #define SOAP_END 9 1148 #define SOAP_BEGIN_SECURITY 10 1149 #define SOAP_IN_SECURITY 11 1150 #define SOAP_END_SECURITY 12 1151 1152 /* DEBUG macros */ 1153 1154 #ifndef WITH_LEAN 1155 # ifdef DEBUG 1156 # ifndef SOAP_DEBUG 1157 # define SOAP_DEBUG 1158 # endif 1159 # ifndef SOAP_MEM_DEBUG 1160 # define SOAP_MEM_DEBUG 1161 # endif 1162 # endif 1163 #endif 1164 1165 #ifdef SOAP_MEM_DEBUG 1166 # ifndef SOAP_MALLOC 1167 # define SOAP_MALLOC(soap, size) soap_track_malloc(soap, __FILE__, __LINE__, size) 1168 # endif 1169 # ifndef SOAP_FREE 1170 # define SOAP_FREE(soap, ptr) soap_track_free(soap, __FILE__, __LINE__, ptr) 1171 # endif 1172 #endif 1173 1174 #ifndef SOAP_MALLOC /* use libc malloc */ 1175 # define SOAP_MALLOC(soap, size) malloc(size) 1176 #endif 1177 1178 #ifndef SOAP_FREE /* use libc free */ 1179 # define SOAP_FREE(soap, ptr) free(ptr) 1180 #endif 1181 1182 #ifdef SOAP_DEBUG 1183 # ifndef SOAP_MESSAGE 1184 # define SOAP_MESSAGE fprintf 1185 # endif 1186 # ifndef DBGLOG 1187 # define DBGLOG(DBGFILE, CMD) \ 1188 { if (soap)\ 1189 { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ 1190 soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ 1191 if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ 1192 { FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\ 1193 CMD;\ 1194 fflush(fdebug);\ 1195 }\ 1196 }\ 1197 } 1198 # endif 1199 # ifndef DBGMSG 1200 # define DBGMSG(DBGFILE, MSG, LEN) \ 1201 { if (soap)\ 1202 { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ 1203 soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ 1204 if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ 1205 { fwrite((MSG), 1, (LEN), soap->fdebug[SOAP_INDEX_##DBGFILE]);\ 1206 fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\ 1207 }\ 1208 }\ 1209 } 1210 # endif 1211 # ifndef DBGFUN 1212 # define DBGFUN(FNAME) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s()\n", __FILE__, __LINE__, FNAME)) 1213 # define DBGFUN1(FNAME, FMT, ARG) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s("FMT")\n", __FILE__, __LINE__, FNAME, (ARG))) 1214 # define DBGFUN2(FNAME, FMT1, ARG1, FMT2, ARG2) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s("FMT1", "FMT2")\n", __FILE__, __LINE__, FNAME, (ARG1), (ARG2))) 1215 # 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))) 1216 # endif 1217 # ifndef DBGHEX 1218 # define DBGHEX(DBGFILE, MSG, LEN) \ 1219 { if (soap)\ 1220 { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ 1221 soap_open_logfile(soap, SOAP_INDEX_##DBGFILE);\ 1222 if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ 1223 { int i; char *s;\ 1224 for (s = (char*)(MSG), i = (LEN); i; i--)\ 1225 fprintf(soap->fdebug[SOAP_INDEX_##DBGFILE], "%2.2X ", (int)*s++&0xFF);\ 1226 fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\ 1227 }\ 1228 }\ 1229 } 1230 # endif 1231 #else 1232 # define DBGLOG(DBGFILE, CMD) 1233 # define DBGMSG(DBGFILE, MSG, LEN) 1234 # define DBGFUN(FNAME) 1235 # define DBGFUN1(FNAME, FMT, ARG) 1236 # define DBGFUN2(FNAME, FMT1, ARG1, FMT2, ARG2) 1237 # define DBGFUN3(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3) 1238 # define DBGHEX(DBGFILE, MSG, LEN) 1239 #endif 1240 1241 /* UCS-4 requires 32 bits (0-7FFFFFFF, the sign bit is used by gSOAP to distinguish XML entities) */ 1242 typedef soap_int32 soap_wchar; 1243 1244 /* namespace table row */ 1245 struct Namespace 1246 { const char *id; 1247 const char *ns; 1248 const char *in; 1249 char *out; 1250 }; 1251 1252 /* namespace stack */ 1253 struct soap_nlist 1254 { struct soap_nlist *next; 1255 unsigned int level; /* nesting depth level */ 1256 short index; /* corresponding entry in ns mapping table */ 1257 char *ns; /* only set when parsed ns URI is not in the ns mapping table */ 1258 char id[1]; /* the actual string value flows into the allocated region below this struct */ 1259 }; 1260 1261 /* block stack for nested block allocations */ 1262 struct soap_blist 1263 { struct soap_blist *next; 1264 char *ptr; 1265 size_t size; 1266 }; 1267 1268 /* array layout */ 1269 struct soap_array 1270 { void *__ptr; 1271 int __size; 1272 }; 1273 1274 /* pointer serialization management */ 1275 struct soap_plist 1276 { struct soap_plist *next; 1277 const void *ptr; 1278 const struct soap_array *array; 1279 int type; 1280 int id; 1281 char mark1; 1282 char mark2; 1283 }; 1284 1285 /* block allocation for pointer serialization management */ 1286 struct soap_pblk 1287 { struct soap_pblk *next; 1288 struct soap_plist plist[SOAP_PTRBLK]; 1289 }; 1290 1291 #ifdef SOAP_MEM_DEBUG 1292 /* malloc/free tracking for debugging */ 1293 struct soap_mlist 1294 { struct soap_mlist *next; 1295 const void *ptr; 1296 const char *file; 1297 int line; 1298 short live; 1299 }; 1300 #endif 1301 1302 /* class allocation list */ 1303 struct soap_clist 1304 { struct soap_clist *next; 1305 void *ptr; 1306 int type; 1307 int size; 1308 int (*fdelete)(struct soap_clist*); 1309 }; 1310 1311 /* attributes */ 1312 struct soap_attribute 1313 { struct soap_attribute *next; 1314 char *value; 1315 size_t size; 1316 char *ns; 1317 short visible; 1318 char name[1]; /* the actual name string flows into the allocated region below this struct */ 1319 }; 1320 1321 #ifndef WITH_LEAN 1322 struct soap_cookie 1323 { struct soap_cookie *next; 1324 char *name; 1325 char *value; 1326 char *domain; 1327 char *path; 1328 time_t expire; /* client-side: local time to expire */ 1329 long maxage; /* server-side: seconds to expire */ 1330 unsigned int version; 1331 short secure; 1332 short session; /* server-side */ 1333 short env; /* server-side: got cookie from client and should not be (re)send */ 1334 short modified; /* server-side: client cookie was modified and should be send */ 1335 }; 1336 #endif 1337 1338 #ifdef __cplusplus 1339 SOAP_FMAC1 struct soap_multipart* SOAP_FMAC2 soap_next_multipart(struct soap_multipart*); 1340 1341 class soap_multipart_iterator 1342 { public: 1343 struct soap_multipart *content; 1344 bool operator==(const soap_multipart_iterator& iter) const 1345 { return (bool)(content == iter.content); } 1346 bool operator!=(const soap_multipart_iterator& iter) const 1347 { return (bool)(content != iter.content); } 1348 struct soap_multipart &operator*() const 1349 { return *content; } 1350 soap_multipart_iterator &operator++() 1351 { content = soap_next_multipart(content); return *this; } 1352 soap_multipart_iterator() : content(NULL) 1353 { } 1354 soap_multipart_iterator(struct soap_multipart *p) : content(p) 1355 { } 1356 }; 1357 #endif 1358 1359 #ifndef WITH_LEANER 1360 struct soap_dime 1361 { size_t count; 1362 size_t size; 1363 size_t chunksize; 1364 size_t buflen; 1365 char flags; 1366 char *ptr; 1367 const char *id; 1368 const char *type; 1369 const char *options; 1370 struct soap_multipart *list; /* list of DIME attachments received */ 1371 struct soap_multipart *first, *last; /* temporary in/out queue */ 1372 #ifdef __cplusplus 1373 soap_multipart_iterator begin() 1374 { soap_multipart_iterator iter(list); return iter; }; 1375 soap_multipart_iterator end() 1376 { soap_multipart_iterator iter(NULL); return iter; }; 1377 #endif 1378 }; 1379 #endif 1380 1381 #ifndef WITH_LEANER 1382 struct soap_mime 1383 { char *boundary; /* MIME boundary */ 1384 const char *start; /* MIME start ID */ 1385 struct soap_multipart *list; /* list of MIME attachments received */ 1386 struct soap_multipart *first, *last; /* temporary in/out queue */ 1387 #ifdef __cplusplus 1388 soap_multipart_iterator begin() 1389 { soap_multipart_iterator iter(list); return iter; }; 1390 soap_multipart_iterator end() 1391 { soap_multipart_iterator iter(NULL); return iter; }; 1392 #endif 1393 }; 1394 #endif 1395 1396 #ifndef WITH_LEANER 1397 /* RFC2045 MIME content transfer encodings */ 1398 enum soap_mime_encoding 1399 { SOAP_MIME_NONE, 1400 SOAP_MIME_7BIT, 1401 SOAP_MIME_8BIT, 1402 SOAP_MIME_BINARY, 1403 SOAP_MIME_QUOTED_PRINTABLE, 1404 SOAP_MIME_BASE64, 1405 SOAP_MIME_IETF_TOKEN, 1406 SOAP_MIME_X_TOKEN 1407 }; 1408 #endif 1409 1410 #ifndef WITH_LEANER 1411 /* DIME/MIME multipart list */ 1412 struct soap_multipart 1413 { struct soap_multipart *next; 1414 char *ptr; /* points to raw data content */ 1415 size_t size; /* size of data content */ 1416 const char *id; /* DIME/MIME content ID or form data name */ 1417 const char *type; /* DIME/MIME type (MIME type format) */ 1418 const char *options; /* DIME options */ 1419 enum soap_mime_encoding encoding; /* MIME Content-Transfer-Encoding */ 1420 const char *location; /* MIME Content-Location (optional) */ 1421 const char *description; /* MIME Content-Description (optional) */ 1422 #ifdef __cplusplus 1423 typedef soap_multipart_iterator iterator; 1424 #endif 1425 }; 1426 #endif 1427 1428 #ifndef WITH_LEANER 1429 /* attachment DIME and MTOM XOP forwarding */ 1430 struct soap_xlist 1431 { struct soap_xlist *next; 1432 unsigned char **ptr; 1433 int *size; 1434 char *id; 1435 char **type; 1436 char **options; 1437 }; 1438 #endif 1439 1440 /******************************************************************************/ 1441 1442 #ifndef WITH_LEANER 1443 #ifdef __cplusplus 1444 class soap_dom_attribute_iterator 1445 { public: 1446 struct soap_dom_attribute *att; 1447 const char *nstr; 1448 const char *name; 1449 bool operator==(const soap_dom_attribute_iterator&) const; 1450 bool operator!=(const soap_dom_attribute_iterator&) const; 1451 struct soap_dom_attribute &operator*() const; 1452 soap_dom_attribute_iterator &operator++(); 1453 soap_dom_attribute_iterator(); 1454 soap_dom_attribute_iterator(struct soap_dom_attribute*); 1455 ~soap_dom_attribute_iterator(); 1456 }; 1457 #endif 1458 #endif 1459 1460 #ifndef WITH_LEANER 1461 struct soap_dom_attribute 1462 { struct soap_dom_attribute *next; 1463 const char *nstr; 1464 char *name; 1465 char *data; 1466 wchar_t *wide; 1467 struct soap *soap; 1468 #ifdef __cplusplus 1469 typedef soap_dom_attribute_iterator iterator; 1470 struct soap_dom_attribute &set(const char *nstr, const char *name); /* set namespace and name */ 1471 struct soap_dom_attribute &set(const char *data); /* set data */ 1472 soap_dom_attribute_iterator begin(); 1473 soap_dom_attribute_iterator end(); 1474 soap_dom_attribute_iterator find(const char *nstr, const char *name); 1475 void unlink(); 1476 soap_dom_attribute(); 1477 soap_dom_attribute(struct soap *soap); 1478 soap_dom_attribute(struct soap *soap, const char *nstr, const char *name, const char *data); 1479 ~soap_dom_attribute(); 1480 #endif 1481 }; 1482 #endif 1483 1484 #ifndef WITH_LEANER 1485 #ifdef __cplusplus 1486 class soap_dom_element_iterator 1487 { public: 1488 struct soap_dom_element *elt; 1489 const char *nstr; 1490 const char *name; 1491 int type; 1492 bool operator==(const soap_dom_element_iterator&) const; 1493 bool operator!=(const soap_dom_element_iterator&) const; 1494 struct soap_dom_element &operator*() const; 1495 soap_dom_element_iterator &operator++(); 1496 soap_dom_element_iterator(); 1497 soap_dom_element_iterator(struct soap_dom_element*); 1498 ~soap_dom_element_iterator(); 1499 }; 1500 #endif 1501 #endif 1502 1503 #ifndef WITH_LEANER 1504 struct soap_dom_element 1505 { struct soap_dom_element *next; /* next sibling */ 1506 struct soap_dom_element *prnt; /* parent */ 1507 struct soap_dom_element *elts; /* list of child elements */ 1508 struct soap_dom_attribute *atts; /* list of attributes */ 1509 const char *nstr; /* namespace string */ 1510 char *name; /* element tag name */ 1511 char *data; /* element content data (with SOAP_C_UTFSTRING flag set) */ 1512 wchar_t *wide; /* element content data */ 1513 int type; /* optional: serialized C/C++ data type */ 1514 void *node; /* optional: pointer to serialized C/C++ data */ 1515 char *head; /* leading whitespace to start tag */ 1516 char *tail; /* leading whitespace to end tag */ 1517 struct soap *soap; /* soap context that manages this node */ 1518 #ifdef __cplusplus 1519 typedef soap_dom_element_iterator iterator; 1520 struct soap_dom_element &set(const char *nstr, const char *name); 1521 struct soap_dom_element &set(const char *data); 1522 struct soap_dom_element &set(void *node, int type); 1523 struct soap_dom_element &add(struct soap_dom_element*); 1524 struct soap_dom_element &add(struct soap_dom_element&); 1525 struct soap_dom_element &add(struct soap_dom_attribute*); 1526 struct soap_dom_element &add(struct soap_dom_attribute&); 1527 soap_dom_element_iterator begin(); 1528 soap_dom_element_iterator end(); 1529 soap_dom_element_iterator find(const char *nstr, const char *name); 1530 soap_dom_element_iterator find(int type); 1531 void unlink(); 1532 soap_dom_element(); 1533 soap_dom_element(struct soap *soap); 1534 soap_dom_element(struct soap *soap, const char *nstr, const char *name); 1535 soap_dom_element(struct soap *soap, const char *nstr, const char *name, const char *data); 1536 soap_dom_element(struct soap *soap, const char *nstr, const char *name, void *node, int type); 1537 ~soap_dom_element(); 1538 #endif 1539 }; 1540 SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_next_element(struct soap_dom_element *elt); 1541 SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_dom_next_attribute(struct soap_dom_attribute *att); 1542 #endif 1543 1544 #if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT) 1545 } 1546 extern std::ostream &operator<<(std::ostream&, const struct soap_dom_element&); 1547 extern std::istream &operator>>(std::istream&, struct soap_dom_element&); 1548 extern "C" { 1549 #endif 1550 1551 /******************************************************************************/ 1552 1553 #ifdef WIN32 1554 # ifdef SOAP_STD_EXPORTS 1555 # define SOAP_STD_API __declspec(dllexport) 1556 # else 1557 # define SOAP_STD_API 1558 # endif 1559 #else 1560 # define SOAP_STD_API 1561 #endif 1562 1563 struct SOAP_STD_API soap 1564 { short state; /* 0 = uninitialized, 1 = initialized, 2 = copy of another soap struct */ 1565 short version; /* 1 = SOAP1.1 and 2 = SOAP1.2 (set automatically from namespace URI in nsmap table) */ 1566 soap_mode mode; 1567 soap_mode imode; 1568 soap_mode omode; 1569 const char *float_format; /* user-definable format string for floats (<1024 chars) */ 1570 const char *double_format; /* user-definable format string for doubles (<1024 chars) */ 1571 const char *dime_id_format; /* user-definable format string for integer DIME id (<SOAP_TAGLEN chars) */ 1572 const char *http_version; /* HTTP version used "1.0" or "1.1" */ 1573 const char *http_content; /* optional custom response content type (with SOAP_FILE) */ 1574 const char *encodingStyle; /* default = NULL which means that SOAP encoding is used */ 1575 const char *actor; /* SOAP-ENV:actor or role attribute value */ 1576 const char *lang; /* xml:lang attribute value of SOAP-ENV:Text */ 1577 int recv_timeout; /* when > 0, gives socket recv timeout in seconds, < 0 in usec */ 1578 int send_timeout; /* when > 0, gives socket send timeout in seconds, < 0 in usec */ 1579 int connect_timeout; /* when > 0, gives socket connect() timeout in seconds, < 0 in usec */ 1580 int accept_timeout; /* when > 0, gives socket accept() timeout in seconds, < 0 in usec */ 1581 int socket_flags; /* socket recv() and send() flags, e.g. set to MSG_NOSIGNAL to disable sigpipe */ 1582 int connect_flags; /* connect() SOL_SOCKET sockopt flags, e.g. set to SO_DEBUG to debug socket */ 1583 int bind_flags; /* bind() SOL_SOCKET sockopt flags, e.g. set to SO_REUSEADDR to enable reuse */ 1584 int accept_flags; /* accept() SOL_SOCKET sockopt flags */ 1585 unsigned short linger_time; /* linger time for SO_LINGER option */ 1586 const struct Namespace *namespaces; /* Pointer to global namespace mapping table */ 1587 struct Namespace *local_namespaces; /* Local namespace mapping table */ 1588 struct soap_nlist *nlist; /* namespace stack */ 1589 struct soap_blist *blist; /* block allocation stack */ 1590 struct soap_clist *clist; /* class instance allocation list */ 1591 void *alist; /* memory allocation (malloc) list */ 1592 struct soap_ilist *iht[SOAP_IDHASH]; 1593 struct soap_plist *pht[SOAP_PTRHASH]; 1594 struct soap_pblk *pblk; /* plist block allocation */ 1595 short pidx; /* plist block allocation */ 1596 struct SOAP_ENV__Header *header; 1597 struct SOAP_ENV__Fault *fault; 1598 int idnum; 1599 void *user; /* to pass user-defined data */ 1600 struct soap_plugin *plugins; /* linked list of plug-in data */ 1601 char *userid; /* HTTP Basic authorization userid */ 1602 char *passwd; /* HTTP Basic authorization passwd */ 1603 int (*fpost)(struct soap*, const char*, const char*, int, const char*, const char*, size_t); 1604 int (*fget)(struct soap*); 1605 int (*fput)(struct soap*); 1606 int (*fdel)(struct soap*); 1607 int (*fhead)(struct soap*); 1608 int (*fform)(struct soap*); 1609 int (*fposthdr)(struct soap*, const char*, const char*); 1610 int (*fresponse)(struct soap*, int, size_t); 1611 int (*fparse)(struct soap*); 1612 int (*fparsehdr)(struct soap*, const char*, const char*); 1613 int (*fheader)(struct soap*); 1614 int (*fresolve)(struct soap*, const char*, struct in_addr* inaddr); 1615 int (*fconnect)(struct soap*, const char*, const char*, int); 1616 int (*fdisconnect)(struct soap*); 1617 int (*fclosesocket)(struct soap*, SOAP_SOCKET); 1618 int (*fshutdownsocket)(struct soap*, SOAP_SOCKET, int); 1619 SOAP_SOCKET (*fopen)(struct soap*, const char*, const char*, int); 1620 SOAP_SOCKET (*faccept)(struct soap*, SOAP_SOCKET, struct sockaddr*, int *n); 1621 int (*fclose)(struct soap*); 1622 int (*fsend)(struct soap*, const char*, size_t); 1623 size_t (*frecv)(struct soap*, char*, size_t); 1624 int (*fpoll)(struct soap*); 1625 void (*fseterror)(struct soap*, const char **c, const char **s); 1626 int (*fignore)(struct soap*, const char*); 1627 int (*fserveloop)(struct soap*); 1628 void *(*fplugin)(struct soap*, const char*); 1629 void *(*fmalloc)(struct soap*, size_t); 1630 #ifndef WITH_LEANER 1631 int (*fprepareinit)(struct soap*); 1632 int (*fpreparesend)(struct soap*, const char*, size_t); 1633 int (*fpreparerecv)(struct soap*, const char*, size_t); 1634 int (*fpreparefinal)(struct soap*); 1635 void *(*fdimereadopen)(struct soap*, void*, const char*, const char*, const char*); 1636 void *(*fdimewriteopen)(struct soap*, const char*, const char*, const char*); 1637 void (*fdimereadclose)(struct soap*, void*); 1638 void (*fdimewriteclose)(struct soap*, void*); 1639 size_t (*fdimeread)(struct soap*, void*, char*, size_t); 1640 int (*fdimewrite)(struct soap*, void*, const char*, size_t); 1641 void *(*fmimereadopen)(struct soap*, void*, const char*, const char*, const char*); 1642 void *(*fmimewriteopen)(struct soap*, void*, const char*, const char*, const char*, enum soap_mime_encoding); 1643 void (*fmimereadclose)(struct soap*, void*); 1644 void (*fmimewriteclose)(struct soap*, void*); 1645 size_t (*fmimeread)(struct soap*, void*, char*, size_t); 1646 int (*fmimewrite)(struct soap*, void*, const char*, size_t); 1647 #endif 1648 SOAP_SOCKET master; 1649 SOAP_SOCKET socket; 1650 #if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT) 1651 std::ostream *os; 1652 std::istream *is; 1653 #else 1654 void *os; /* preserve struct size */ 1655 void *is; /* preserve struct size */ 1656 #endif 1657 #ifndef UNDER_CE 1658 int sendfd; 1659 int recvfd; 1660 #else 1661 FILE *sendfd; 1662 FILE *recvfd; 1663 #endif 1664 size_t bufidx; /* index in soap.buf[] */ 1665 size_t buflen; /* length of soap.buf[] content */ 1666 soap_wchar ahead; /* parser lookahead */ 1667 short cdata; /* CDATA parser state */ 1668 short body; /* parsed XML element has a body or not */ 1669 unsigned int level; /* XML nesting level */ 1670 size_t count; /* message length counter */ 1671 size_t length; /* message length as set by HTTP header */ 1672 char *labbuf; /* look-aside buffer */ 1673 size_t lablen; /* look-aside buffer allocated length */ 1674 size_t labidx; /* look-aside buffer index to available part */ 1675 char buf[SOAP_BUFLEN];/* send and receive buffer */ 1676 char msgbuf[1024]; /* in/out buffer for HTTP/MIME headers >=1024 bytes */ 1677 char tmpbuf[1024]; /* in/out buffer for HTTP/MIME headers, simpleType values, element and attribute tag names, and DIME must be >=1024 bytes */ 1678 char tag[SOAP_TAGLEN]; 1679 char id[SOAP_TAGLEN]; 1680 char href[SOAP_TAGLEN]; 1681 char type[SOAP_TAGLEN]; 1682 char arrayType[SOAP_TAGLEN]; 1683 char arraySize[SOAP_TAGLEN]; 1684 char arrayOffset[SOAP_TAGLEN]; 1685 short other; 1686 short position; 1687 int positions[SOAP_MAXDIMS]; 1688 short root; 1689 struct soap_attribute *attributes; /* attribute list */ 1690 short encoding; /* when set, output encodingStyle */ 1691 short mustUnderstand; /* a mustUnderstand element was parsed or is output */ 1692 short null; /* parsed XML is xsi:nil */ 1693 short ns; /* when not set, output full xmlns bindings */ 1694 short part; /* parsing state */ 1695 short alloced; 1696 short peeked; 1697 size_t chunksize; 1698 size_t chunkbuflen; 1699 char endpoint[SOAP_TAGLEN]; 1700 char path[SOAP_TAGLEN]; 1701 char host[SOAP_TAGLEN]; 1702 char *action; 1703 char *authrealm; /* HTTP authentication realm */ 1704 char *prolog; /* XML declaration prolog */ 1705 unsigned long ip; /* IP number */ 1706 int port; /* port number */ 1707 short keep_alive; /* connection should be kept open */ 1708 short tcp_keep_alive; /* enable SO_KEEPALIVE */ 1709 unsigned int tcp_keep_idle; /* set TCP_KEEPIDLE */ 1710 unsigned int tcp_keep_intvl; /* set TCP_KEEPINTVL */ 1711 unsigned int tcp_keep_cnt; /* set TCP_KEEPCNT */ 1712 unsigned int max_keep_alive; /* maximum keep-alive session (default=100) */ 1713 const char *proxy_http_version;/* HTTP version of proxy "1.0" or "1.1" */ 1714 const char *proxy_host; /* Proxy Server host name */ 1715 int proxy_port; /* Proxy Server port (default = 8080) */ 1716 const char *proxy_userid; /* Proxy Authorization user name */ 1717 const char *proxy_passwd; /* Proxy Authorization password */ 1718 const char *proxy_from; /* X-Forwarding-For header returned by proxy */ 1719 int status; /* -1 when request, else error code to be returned by server */ 1720 int error; 1721 int errmode; 1722 int errnum; 1723 #ifndef WITH_LEANER 1724 struct soap_dom_element *dom; 1725 struct soap_dime dime; 1726 struct soap_mime mime; 1727 struct soap_xlist *xlist; 1728 #endif 1729 #if !defined(WITH_LEAN) || defined(SOAP_DEBUG) 1730 const char *logfile[SOAP_MAXLOGS]; 1731 FILE *fdebug[SOAP_MAXLOGS]; 1732 struct soap_mlist *mht[SOAP_PTRHASH]; 1733 #endif 1734 #ifndef WITH_LEAN 1735 const char *c14ninclude; 1736 const char *c14nexclude; 1737 struct soap_cookie *cookies; 1738 const char *cookie_domain; 1739 const char *cookie_path; 1740 int cookie_max; 1741 #endif 1742 #ifndef WITH_NOIO 1743 int ipv6_multicast_if; /* always include this to keep the soap struct size the same in v4 and v6 */ 1744 char* ipv4_multicast_if; /* always include this to keep the soap struct size the same in v4 and v6 */ 1745 int ipv4_multicast_ttl; /* multicast scope */ 1746 #ifdef WITH_IPV6 1747 struct sockaddr_storage peer; /* IPv6: set by soap_accept and by UDP recv */ 1748 #else 1749 struct sockaddr_in peer; /* IPv4: set by soap_connect/soap_accept and by UDP recv */ 1750 #endif 1751 #endif 1752 size_t peerlen; 1753 #ifdef WITH_OPENSSL 1754 int (*fsslauth)(struct soap*); 1755 int (*fsslverify)(int, X509_STORE_CTX*); 1756 BIO *bio; 1757 SSL *ssl; 1758 SSL_CTX *ctx; 1759 SSL_SESSION *session; 1760 #else 1761 void *fsslauth; /* dummy members, to preserve struct size */ 1762 void *fsslverify; 1763 void *bio; 1764 void *ssl; 1765 void *ctx; 1766 void *session; 1767 #endif 1768 unsigned short ssl_flags; 1769 const char *keyfile; 1770 const char *password; 1771 const char *dhfile; 1772 const char *cafile; 1773 const char *capath; 1774 const char *crlfile; 1775 const char *randfile; 1776 char session_host[SOAP_TAGLEN]; 1777 int session_port; 1778 #ifdef WITH_C_LOCALE 1779 locale_t c_locale; /* set to C locale by default */ 1780 #else 1781 void *c_locale; 1782 #endif 1783 #ifdef WITH_ZLIB 1784 z_stream *d_stream; /* decompression stream */ 1785 uLong z_crc; /* internal gzip crc */ 1786 #else 1787 void *d_stream; /* dummy members, to preserve struct size */ 1788 soap_int32 z_crc; 1789 #endif 1790 short zlib_state; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_INFLATE */ 1791 short zlib_in; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */ 1792 short zlib_out; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */ 1793 char *z_buf; /* buffer */ 1794 size_t z_buflen; 1795 unsigned short z_level; /* compression level to be used (0=none, 1=fast to 9=best) */ 1796 float z_ratio_in; /* detected compression ratio compressed_length/length of inbound message */ 1797 float z_ratio_out; /* detected compression ratio compressed_length/length of outbound message */ 1798 #ifdef WMW_RPM_IO 1799 void *rpmreqid; 1800 #endif 1801 #ifdef __cplusplus 1802 soap(); 1803 soap(soap_mode); 1804 soap(soap_mode, soap_mode); 1805 soap(struct soap&); 1806 virtual ~soap(); 1807 #else 1808 void (*dummy)(); 1809 #endif 1810 }; 1811 1812 struct soap_code_map 1813 { long code; 1814 const char *string; 1815 }; 1816 1817 /* forwarding list */ 1818 struct soap_flist 1819 { struct soap_flist *next; 1820 int type; 1821 void *ptr; 1822 unsigned int level; 1823 size_t len; 1824 void (*fcopy)(struct soap*, int, int, void*, size_t, const void*, size_t); 1825 }; 1826 1827 /* id-ref forwarding list */ 1828 struct soap_ilist 1829 { struct soap_ilist *next; 1830 int type; 1831 size_t size; 1832 void *link; 1833 void *copy; 1834 struct soap_flist *flist; 1835 void *ptr; 1836 unsigned int level; 1837 char id[1]; /* the actual id string value flows into the allocated region below this struct */ 1838 }; 1839 1840 struct soap_plugin 1841 { struct soap_plugin *next; 1842 const char *id; 1843 void *data; 1844 int (*fcopy)(struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src); 1845 void (*fdelete)(struct soap *soap, struct soap_plugin *p); /* should delete fields of plugin only and not free(p) */ 1846 }; 1847 1848 #ifndef WITH_NONAMESPACES 1849 extern SOAP_NMAC struct Namespace namespaces[]; 1850 #endif 1851 1852 #ifndef WITH_LEAN 1853 # define soap_get0(soap) (((soap)->bufidx>=(soap)->buflen && soap_recv(soap)) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx]) 1854 # define soap_get1(soap) (((soap)->bufidx>=(soap)->buflen && soap_recv(soap)) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx++]) 1855 #else 1856 soap_wchar soap_get0(struct soap*); 1857 soap_wchar soap_get1(struct soap*); 1858 #endif 1859 1860 #define soap_revget1(soap) ((soap)->bufidx--) 1861 #define soap_unget(soap, c) ((soap)->ahead = c) 1862 #define soap_register_plugin(soap, plugin) soap_register_plugin_arg(soap, plugin, NULL) 1863 #define soap_imode(soap, n) ((soap)->mode = (soap)->imode = (n)) 1864 #define soap_set_imode(soap, n) ((soap)->imode |= (n)) 1865 #define soap_clr_imode(soap, n) ((soap)->imode &= ~(n)) 1866 #define soap_omode(soap, n) ((soap)->mode = (soap)->omode = (n)) 1867 #define soap_set_omode(soap, n) ((soap)->omode |= (n)) 1868 #define soap_clr_omode(soap, n) ((soap)->omode &= ~(n)) 1869 #define soap_set_mode(soap, n) ((soap)->imode |= (n), (soap)->omode |= (n)) 1870 #define soap_clr_mode(soap, n) ((soap)->imode &= ~(n), (soap)->omode &= ~(n)) 1871 #define soap_destroy(soap) soap_delete((soap), NULL) 1872 1873 #ifdef HAVE_STRRCHR 1874 # define soap_strrchr(s, t) strrchr(s, t) 1875 #else 1876 SOAP_FMAC1 char* SOAP_FMAC2 soap_strrchr(const char *s, int t); 1877 #endif 1878 1879 #ifdef HAVE_STRTOL 1880 # define soap_strtol(s, t, b) strtol(s, t, b) 1881 #else 1882 SOAP_FMAC1 long SOAP_FMAC2 soap_strtol(const char *s, char **t, int b); 1883 #endif 1884 1885 #ifdef HAVE_STRTOUL 1886 # define soap_strtoul(s, t, b) strtoul(s, t, b) 1887 #else 1888 SOAP_FMAC1 unsigned long SOAP_FMAC2 soap_strtoul(const char *s, char **t, int b); 1889 #endif 1890 1891 #if defined(WITH_OPENSSL) 1892 # define soap_random soap_rand() 1893 SOAP_FMAC1 int SOAP_FMAC2 soap_rand(void); 1894 #elif defined(HAVE_RANDOM) 1895 # define soap_random (int)random() 1896 #else 1897 # define soap_random rand() 1898 #endif 1899 1900 #ifdef WITH_NOIDREF 1901 # define soap_embedded(s, p, t) (0) 1902 # define soap_id_lookup(s, i, p, t, n, k) (p) 1903 # define soap_id_forward(s, h, p, len, st, tt, n, k, fc) (p) 1904 # define soap_reference(s, a, t) (1) 1905 # define soap_array_reference(s, p, a, n, t) (1) 1906 # define soap_embed(s, p, a, n, t, pp) (0) 1907 # define soap_embedded_id(s, i, p, t) (i) 1908 # define soap_is_embedded(s, p) (0) 1909 # define soap_is_single(s, p) (1) 1910 # define soap_lookup_type(s, i) (0) 1911 # define soap_getindependent(s) (0) 1912 # define soap_putindependent(s) (0) 1913 # define soap_getelement(s, n) (n) 1914 # define soap_putelement(s, p, t, i, n) (0) 1915 # define soap_markelement(s, p, n) (0) 1916 #endif 1917 1918 SOAP_FMAC1 void SOAP_FMAC2 soap_header(struct soap*); 1919 SOAP_FMAC1 void SOAP_FMAC2 soap_fault(struct soap*); 1920 SOAP_FMAC1 const char** SOAP_FMAC2 soap_faultcode(struct soap*); 1921 SOAP_FMAC1 const char** SOAP_FMAC2 soap_faultsubcode(struct soap*); 1922 SOAP_FMAC1 const char** SOAP_FMAC2 soap_faultstring(struct soap*); 1923 SOAP_FMAC1 const char** SOAP_FMAC2 soap_faultdetail(struct soap*); 1924 SOAP_FMAC1 void SOAP_FMAC2 soap_serializeheader(struct soap*); 1925 SOAP_FMAC1 int SOAP_FMAC2 soap_putheader(struct soap*); 1926 SOAP_FMAC1 int SOAP_FMAC2 soap_getheader(struct soap*); 1927 SOAP_FMAC1 void SOAP_FMAC2 soap_serializefault(struct soap*); 1928 SOAP_FMAC1 int SOAP_FMAC2 soap_putfault(struct soap*); 1929 SOAP_FMAC1 int SOAP_FMAC2 soap_getfault(struct soap*); 1930 1931 SOAP_FMAC1 void SOAP_FMAC2 soap_ssl_init(); 1932 SOAP_FMAC1 int SOAP_FMAC2 soap_poll(struct soap*); 1933 SOAP_FMAC1 int SOAP_FMAC2 soap_connect_command(struct soap*, int, const char*, const char*); 1934 SOAP_FMAC1 int SOAP_FMAC2 soap_connect(struct soap*, const char*, const char*); 1935 SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_bind(struct soap*, const char*, int, int); 1936 SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_accept(struct soap*); 1937 SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_accept(struct soap*); 1938 SOAP_FMAC1 const char * SOAP_FMAC2 soap_ssl_error(struct soap*, int); 1939 1940 SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_server_context(struct soap*, unsigned short, const char*, const char*, const char*, const char*, const char*, const char*, const char*); 1941 SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_client_context(struct soap*, unsigned short, const char*, const char*, const char*, const char*, const char*); 1942 1943 SOAP_FMAC1 int SOAP_FMAC2 soap_puthttphdr(struct soap*, int status, size_t count); 1944 1945 SOAP_FMAC1 const char* SOAP_FMAC2 soap_get_header_attribute(struct soap*, const char*, const char*); 1946 SOAP_FMAC1 const char* SOAP_FMAC2 soap_decode_key(char*, size_t, const char*); 1947 SOAP_FMAC1 const char* SOAP_FMAC2 soap_decode_val(char*, size_t, const char*); 1948 1949 SOAP_FMAC1 size_t SOAP_FMAC2 soap_hash(const char*); 1950 SOAP_FMAC1 void SOAP_FMAC2 soap_set_endpoint(struct soap*, const char*); 1951 SOAP_FMAC1 int SOAP_FMAC2 soap_flush_raw(struct soap*, const char*, size_t); 1952 SOAP_FMAC1 int SOAP_FMAC2 soap_flush(struct soap*); 1953 SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_get(struct soap*); 1954 SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getchar(struct soap*); 1955 SOAP_FMAC1 int SOAP_FMAC2 soap_tag_cmp(const char*, const char*); 1956 SOAP_FMAC1 void SOAP_FMAC2 soap_set_fault(struct soap*); 1957 SOAP_FMAC1 int SOAP_FMAC2 soap_sender_fault(struct soap*, const char*, const char*); 1958 SOAP_FMAC1 int SOAP_FMAC2 soap_sender_fault_subcode(struct soap*, const char*, const char*, const char*); 1959 SOAP_FMAC1 int SOAP_FMAC2 soap_receiver_fault(struct soap*, const char*, const char*); 1960 SOAP_FMAC1 int SOAP_FMAC2 soap_receiver_fault_subcode(struct soap*, const char*, const char*, const char*); 1961 SOAP_FMAC1 int SOAP_FMAC2 soap_set_sender_error(struct soap*, const char*, const char*, int); 1962 SOAP_FMAC1 int SOAP_FMAC2 soap_set_receiver_error(struct soap*, const char*, const char*, int); 1963 1964 SOAP_FMAC1 int SOAP_FMAC2 soap_send_raw(struct soap*, const char*, size_t); 1965 SOAP_FMAC1 int SOAP_FMAC2 soap_recv_raw(struct soap*); 1966 SOAP_FMAC1 int SOAP_FMAC2 soap_recv(struct soap*); 1967 SOAP_FMAC1 int SOAP_FMAC2 soap_send(struct soap*, const char*); 1968 SOAP_FMAC1 int SOAP_FMAC2 soap_send2(struct soap*, const char*, const char*); 1969 SOAP_FMAC1 int SOAP_FMAC2 soap_send3(struct soap*, const char*, const char*, const char*); 1970 1971 SOAP_FMAC1 int SOAP_FMAC2 soap_pututf8(struct soap*, unsigned long); 1972 SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getutf8(struct soap*); 1973 1974 SOAP_FMAC1 int SOAP_FMAC2 soap_putbase64(struct soap*, const unsigned char*, int); 1975 SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_getbase64(struct soap*, int*, int); 1976 SOAP_FMAC1 int SOAP_FMAC2 soap_puthex(struct soap*, const unsigned char*, int); 1977 SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_gethex(struct soap*, int*); 1978 1979 #ifndef WITH_LEANER 1980 SOAP_FMAC1 int SOAP_FMAC2 soap_xop_forward(struct soap*, unsigned char**, int*, char**, char**, char**); 1981 SOAP_FMAC1 int SOAP_FMAC2 soap_dime_forward(struct soap*, unsigned char**, int*, char**, char**, char**); 1982 #endif 1983 1984 #ifndef WITH_NOIDREF 1985 SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup_id(struct soap*, void *p, int t, struct soap_plist**); 1986 SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup(struct soap*, const void *p, int t, struct soap_plist**); 1987 SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_enter(struct soap*, const void *p, const struct soap_array *a, int n, int t, struct soap_plist**); 1988 SOAP_FMAC1 int SOAP_FMAC2 soap_array_pointer_lookup(struct soap*, const void *p, const struct soap_array *a, int n, int t, struct soap_plist**); 1989 SOAP_FMAC1 int SOAP_FMAC2 soap_embed(struct soap *soap, const void *p, const struct soap_array *a, int n, const char *tag, int type); 1990 SOAP_FMAC1 struct soap_ilist* SOAP_FMAC2 soap_lookup(struct soap*, const char*); 1991 SOAP_FMAC1 struct soap_ilist* SOAP_FMAC2 soap_enter(struct soap*, const char*); 1992 SOAP_FMAC1 int SOAP_FMAC2 soap_resolve(struct soap*); 1993 SOAP_FMAC1 void SOAP_FMAC2 soap_embedded(struct soap*, const void *p, int t); 1994 SOAP_FMAC1 int SOAP_FMAC2 soap_reference(struct soap*, const void *p, int t); 1995 SOAP_FMAC1 int SOAP_FMAC2 soap_array_reference(struct soap*, const void *p, const struct soap_array *a, int n, int t); 1996 SOAP_FMAC1 int SOAP_FMAC2 soap_embedded_id(struct soap*, int id, const void *p, int t); 1997 SOAP_FMAC1 int SOAP_FMAC2 soap_is_embedded(struct soap*, struct soap_plist*); 1998 SOAP_FMAC1 int SOAP_FMAC2 soap_is_single(struct soap*, struct soap_plist*); 1999 SOAP_FMAC1 void SOAP_FMAC2 soap_set_embedded(struct soap*, struct soap_plist*); 2000 #endif 2001 2002 SOAP_FMAC1 int SOAP_FMAC2 soap_begin_count(struct soap*); 2003 SOAP_FMAC1 int SOAP_FMAC2 soap_end_count(struct soap*); 2004 SOAP_FMAC1 int SOAP_FMAC2 soap_begin_send(struct soap*); 2005 SOAP_FMAC1 int SOAP_FMAC2 soap_end_send(struct soap*); 2006 2007 SOAP_FMAC1 const struct soap_code_map* SOAP_FMAC2 soap_code(const struct soap_code_map*, const char*); 2008 SOAP_FMAC1 long SOAP_FMAC2 soap_code_int(const struct soap_code_map*, const char*, long); 2009 SOAP_FMAC1 const char* SOAP_FMAC2 soap_code_str(const struct soap_code_map*, long); 2010 SOAP_FMAC1 long SOAP_FMAC2 soap_code_bits(const struct soap_code_map*, const char*); 2011 SOAP_FMAC1 const char* SOAP_FMAC2 soap_code_list(struct soap*, const struct soap_code_map*, long); 2012 2013 SOAP_FMAC1 int SOAP_FMAC2 soap_getline(struct soap*, char*, int); 2014 SOAP_FMAC1 int SOAP_FMAC2 soap_begin_recv(struct soap*); 2015 SOAP_FMAC1 int SOAP_FMAC2 soap_end_recv(struct soap*); 2016 2017 SOAP_FMAC1 void* SOAP_FMAC2 soap_malloc(struct soap*, size_t); 2018 SOAP_FMAC1 void SOAP_FMAC2 soap_dealloc(struct soap*, void*); 2019 SOAP_FMAC1 struct soap_clist * SOAP_FMAC2 soap_link(struct soap*, void*, int, int, int (*fdelete)(struct soap_clist*)); 2020 SOAP_FMAC1 void SOAP_FMAC2 soap_unlink(struct soap*, const void*); 2021 SOAP_FMAC1 void SOAP_FMAC2 soap_free_temp(struct soap*); 2022 SOAP_FMAC1 void SOAP_FMAC2 soap_del(struct soap*); 2023 2024 SOAP_FMAC1 void* SOAP_FMAC2 soap_track_malloc(struct soap*, const char*, int, size_t); 2025 SOAP_FMAC1 void SOAP_FMAC2 soap_track_free(struct soap*, const char*, int, void*); 2026 2027 #ifndef WITH_NOIDREF 2028 SOAP_FMAC1 int SOAP_FMAC2 soap_lookup_type(struct soap*, const char *id); 2029 SOAP_FMAC1 void* SOAP_FMAC2 soap_id_lookup(struct soap*, const char *id, void **p, int t, size_t n, unsigned int k); 2030 SOAP_FMAC1 void* SOAP_FMAC2 soap_id_forward(struct soap*, const char *id, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap*, int, int, void*, size_t, const void*, size_t)); 2031 #endif 2032 SOAP_FMAC1 void* SOAP_FMAC2 soap_id_enter(struct soap*, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap*, int, const char*, const char*, size_t*)); 2033 SOAP_FMAC1 void SOAP_FMAC2 soap_fcopy(struct soap *soap, int st, int tt, void *p, size_t, const void *q, size_t n); 2034 2035 SOAP_FMAC1 int SOAP_FMAC2 soap_size(const int *, int); 2036 SOAP_FMAC1 int SOAP_FMAC2 soap_getoffsets(const char *, const int *, int *, int); 2037 SOAP_FMAC1 int SOAP_FMAC2 soap_getsize(const char *, const char *, int *); 2038 SOAP_FMAC1 int SOAP_FMAC2 soap_getsizes(const char *, int *, int); 2039 SOAP_FMAC1 int SOAP_FMAC2 soap_getposition(const char *, int *); 2040 2041 SOAP_FMAC1 char* SOAP_FMAC2 soap_putsize(struct soap*, const char *, int); 2042 SOAP_FMAC1 char* SOAP_FMAC2 soap_putsizesoffsets(struct soap*, const char *, const int *, const int *, int); 2043 SOAP_FMAC1 char* SOAP_FMAC2 soap_putsizes(struct soap*, const char *, const int *, int); 2044 SOAP_FMAC1 char* SOAP_FMAC2 soap_putoffset(struct soap*, int); 2045 SOAP_FMAC1 char* SOAP_FMAC2 soap_putoffsets(struct soap*, const int *, int); 2046 2047 SOAP_FMAC1 int SOAP_FMAC2 soap_closesock(struct soap*); 2048 2049 SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_new(void); 2050 SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_new1(soap_mode); 2051 SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_new2(soap_mode, soap_mode); 2052 SOAP_FMAC1 void SOAP_FMAC2 soap_free(struct soap*); 2053 SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy(const struct soap*); 2054 SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy_context(struct soap*, const struct soap*); 2055 SOAP_FMAC1 void SOAP_FMAC2 soap_copy_stream(struct soap*, struct soap*); 2056 SOAP_FMAC1 void SOAP_FMAC2 soap_init(struct soap*); 2057 SOAP_FMAC1 void SOAP_FMAC2 soap_init1(struct soap*, soap_mode); 2058 SOAP_FMAC1 void SOAP_FMAC2 soap_init2(struct soap*, soap_mode, soap_mode); 2059 SOAP_FMAC1 void SOAP_FMAC2 soap_done(struct soap*); 2060 SOAP_FMAC1 void SOAP_FMAC2 soap_cleanup(struct soap*); 2061 SOAP_FMAC1 void SOAP_FMAC2 soap_begin(struct soap*); 2062 SOAP_FMAC1 void SOAP_FMAC2 soap_end(struct soap*); 2063 SOAP_FMAC1 void SOAP_FMAC2 soap_delete(struct soap*, void*); 2064 2065 #ifdef SOAP_DEBUG 2066 SOAP_FMAC1 void SOAP_FMAC2 soap_set_recv_logfile(struct soap*, const char*); 2067 SOAP_FMAC1 void SOAP_FMAC2 soap_set_sent_logfile(struct soap*, const char*); 2068 SOAP_FMAC1 void SOAP_FMAC2 soap_set_test_logfile(struct soap*, const char*); 2069 SOAP_FMAC1 void SOAP_FMAC2 soap_close_logfiles(struct soap*); 2070 SOAP_FMAC1 void SOAP_FMAC2 soap_open_logfile(struct soap*, int); 2071 #endif 2072 2073 SOAP_FMAC1 const char* SOAP_FMAC2 soap_value(struct soap*); 2074 2075 SOAP_FMAC1 int SOAP_FMAC2 soap_match_tag(struct soap*, const char*, const char *); 2076 SOAP_FMAC1 int SOAP_FMAC2 soap_match_array(struct soap*, const char*); 2077 2078 SOAP_FMAC1 int SOAP_FMAC2 soap_element(struct soap*, const char*, int, const char*); 2079 SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_out(struct soap*, const char *tag, int id, const char *type); 2080 SOAP_FMAC1 int SOAP_FMAC2 soap_array_begin_out(struct soap*, const char *tag, int id, const char *type, const char *offset); 2081 SOAP_FMAC1 int SOAP_FMAC2 soap_element_ref(struct soap*, const char *tag, int id, int href); 2082 SOAP_FMAC1 int SOAP_FMAC2 soap_element_href(struct soap*, const char *tag, int id, const char *ref, const char *val); 2083 SOAP_FMAC1 int SOAP_FMAC2 soap_element_null(struct soap*, const char *tag, int id, const char *type); 2084 SOAP_FMAC1 int SOAP_FMAC2 soap_element_id(struct soap*, const char *tag, int id, const void *p, const struct soap_array *a, int d, const char *type, int n); 2085 SOAP_FMAC1 int SOAP_FMAC2 soap_element_result(struct soap*, const char *tag); 2086 SOAP_FMAC1 void SOAP_FMAC2 soap_check_result(struct soap*, const char *tag); 2087 SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_out(struct soap*, const char *tag); 2088 SOAP_FMAC1 int SOAP_FMAC2 soap_element_start_end_out(struct soap*, const char *tag); 2089 2090 SOAP_FMAC1 int SOAP_FMAC2 soap_attribute(struct soap*, const char*, const char*); 2091 2092 SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_in(struct soap*, const char *tag, int nillable, const char *type); 2093 2094 SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_in(struct soap*, const char *tag); 2095 2096 SOAP_FMAC1 int SOAP_FMAC2 soap_peek_element(struct soap*); 2097 2098 SOAP_FMAC1 void SOAP_FMAC2 soap_retry(struct soap*); 2099 SOAP_FMAC1 void SOAP_FMAC2 soap_revert(struct soap*); 2100 2101 SOAP_FMAC1 char* SOAP_FMAC2 soap_strdup(struct soap*, const char*); 2102 SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstrdup(struct soap*, const wchar_t*); 2103 SOAP_FMAC1 const char * SOAP_FMAC2 soap_strsearch(const char *big, const char *little); 2104 2105 SOAP_FMAC1 int SOAP_FMAC2 soap_string_out(struct soap*, const char *s, int flag); 2106 SOAP_FMAC1 char* SOAP_FMAC2 soap_string_in(struct soap*, int, long, long); 2107 2108 #ifndef WITH_LEANER 2109 SOAP_FMAC1 int SOAP_FMAC2 soap_wstring_out(struct soap*, const wchar_t *s, int flag); 2110 SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstring_in(struct soap*, int, long, long); 2111 #endif 2112 2113 SOAP_FMAC1 int SOAP_FMAC2 soap_match_namespace(struct soap*, const char *, const char*, size_t n1, size_t n2); 2114 2115 SOAP_FMAC1 int SOAP_FMAC2 soap_set_namespaces(struct soap*, const struct Namespace*); 2116 SOAP_FMAC1 void SOAP_FMAC2 soap_set_local_namespaces(struct soap*); 2117 2118 SOAP_FMAC1 void SOAP_FMAC2 soap_pop_namespace(struct soap*); 2119 SOAP_FMAC1 int SOAP_FMAC2 soap_push_namespace(struct soap*, const char *,const char *); 2120 SOAP_FMAC1 const char* SOAP_FMAC2 soap_current_namespace(struct soap *soap, const char *tag); 2121 2122 SOAP_FMAC1 struct soap_nlist* SOAP_FMAC2 soap_lookup_ns(struct soap *soap, const char *tag, size_t n); 2123 2124 SOAP_FMAC1 int SOAP_FMAC2 soap_store_lab(struct soap*, const char*, size_t); 2125 SOAP_FMAC1 int SOAP_FMAC2 soap_append_lab(struct soap*, const char*, size_t); 2126 2127 SOAP_FMAC1 struct soap_blist* SOAP_FMAC2 soap_new_block(struct soap*); 2128 SOAP_FMAC1 void* SOAP_FMAC2 soap_push_block(struct soap*, struct soap_blist*, size_t); 2129 SOAP_FMAC1 void SOAP_FMAC2 soap_pop_block(struct soap*, struct soap_blist*); 2130 SOAP_FMAC1 size_t SOAP_FMAC2 soap_size_block(struct soap*, struct soap_blist*, size_t); 2131 SOAP_FMAC1 char* SOAP_FMAC2 soap_first_block(struct soap*, struct soap_blist*); 2132 SOAP_FMAC1 char* SOAP_FMAC2 soap_next_block(struct soap*, struct soap_blist*); 2133 SOAP_FMAC1 size_t SOAP_FMAC2 soap_block_size(struct soap*, struct soap_blist*); 2134 SOAP_FMAC1 char* SOAP_FMAC2 soap_save_block(struct soap*, struct soap_blist*, char*, int); 2135 SOAP_FMAC1 void SOAP_FMAC2 soap_end_block(struct soap*, struct soap_blist*); 2136 2137 SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_out(struct soap*); 2138 SOAP_FMAC1 int soap_envelope_end_out(struct soap*); 2139 2140 SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_in(struct soap*); 2141 SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_end_in(struct soap*); 2142 2143 SOAP_FMAC1 int SOAP_FMAC2 soap_body_begin_out(struct soap*); 2144 SOAP_FMAC1 int SOAP_FMAC2 soap_body_end_out(struct soap*); 2145 2146 SOAP_FMAC1 int SOAP_FMAC2 soap_body_begin_in(struct soap*); 2147 SOAP_FMAC1 int SOAP_FMAC2 soap_body_end_in(struct soap*); 2148 2149 SOAP_FMAC1 int SOAP_FMAC2 soap_recv_header(struct soap*); 2150 2151 SOAP_FMAC1 int SOAP_FMAC2 soap_response(struct soap*, int); 2152 2153 SOAP_FMAC1 int SOAP_FMAC2 soap_send_empty_response(struct soap*, int status); 2154 SOAP_FMAC1 int SOAP_FMAC2 soap_recv_empty_response(struct soap*); 2155 2156 SOAP_FMAC1 int SOAP_FMAC2 soap_send_fault(struct soap*); 2157 SOAP_FMAC1 int SOAP_FMAC2 soap_recv_fault(struct soap*); 2158 2159 #ifndef WITH_NOSTDLIB 2160 SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault(struct soap*, FILE*); 2161 SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault_location(struct soap*, FILE*); 2162 # ifndef WITH_LEAN 2163 # ifdef __cplusplus 2164 SOAP_FMAC1 void SOAP_FMAC2 soap_stream_fault(struct soap*, std::ostream&); 2165 # endif 2166 SOAP_FMAC1 char* SOAP_FMAC2 soap_sprint_fault(struct soap*, char*, size_t); 2167 # endif 2168 #endif 2169 2170 SOAP_FMAC1 int SOAP_FMAC2 soap_s2byte(struct soap*, const char*, char*); 2171 SOAP_FMAC1 int SOAP_FMAC2 soap_s2short(struct soap*, const char*, short*); 2172 SOAP_FMAC1 int SOAP_FMAC2 soap_s2int(struct soap*, const char*, int*); 2173 SOAP_FMAC1 int SOAP_FMAC2 soap_s2long(struct soap*, const char*, long*); 2174 SOAP_FMAC1 int SOAP_FMAC2 soap_s2LONG64(struct soap*, const char*, LONG64*); 2175 SOAP_FMAC1 int SOAP_FMAC2 soap_s2float(struct soap*, const char*, float*); 2176 SOAP_FMAC1 int SOAP_FMAC2 soap_s2double(struct soap*, const char*, double*); 2177 SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedByte(struct soap*, const char*, unsigned char*); 2178 SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedShort(struct soap*, const char*, unsigned short*); 2179 SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedInt(struct soap*, const char*, unsigned int*); 2180 SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedLong(struct soap*, const char*, unsigned long*); 2181 SOAP_FMAC1 int SOAP_FMAC2 soap_s2ULONG64(struct soap*, const char*, ULONG64*); 2182 SOAP_FMAC1 int SOAP_FMAC2 soap_s2string(struct soap*, const char*, char**); 2183 SOAP_FMAC1 int SOAP_FMAC2 soap_s2QName(struct soap*, const char*, char**); 2184 2185 #ifndef WITH_LEAN 2186 SOAP_FMAC1 int SOAP_FMAC2 soap_s2wchar(struct soap*, const char*, wchar_t**); 2187 SOAP_FMAC1 int SOAP_FMAC2 soap_s2dateTime(struct soap*, const char*, time_t*); 2188 SOAP_FMAC1 char* SOAP_FMAC2 soap_s2base64(struct soap*, const unsigned char*, char*, int); 2189 SOAP_FMAC1 char* SOAP_FMAC2 soap_s2hex(struct soap*, const unsigned char*, char*, int); 2190 #endif 2191 2192 SOAP_FMAC1 const char* SOAP_FMAC2 soap_byte2s(struct soap*, char); 2193 SOAP_FMAC1 const char* SOAP_FMAC2 soap_short2s(struct soap*, short); 2194 SOAP_FMAC1 const char* SOAP_FMAC2 soap_int2s(struct soap*, int); 2195 SOAP_FMAC1 const char* SOAP_FMAC2 soap_long2s(struct soap*, long); 2196 SOAP_FMAC1 const char* SOAP_FMAC2 soap_LONG642s(struct soap*, LONG64); 2197 SOAP_FMAC1 const char* SOAP_FMAC2 soap_float2s(struct soap*, float); 2198 SOAP_FMAC1 const char* SOAP_FMAC2 soap_double2s(struct soap*, double); 2199 SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedByte2s(struct soap*, unsigned char); 2200 SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedShort2s(struct soap*, unsigned short); 2201 SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedInt2s(struct soap*, unsigned int); 2202 SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedLong2s(struct soap*, unsigned long); 2203 SOAP_FMAC1 const char* SOAP_FMAC2 soap_ULONG642s(struct soap*, ULONG64); 2204 SOAP_FMAC1 const char* SOAP_FMAC2 soap_QName2s(struct soap*, const char*); 2205 2206 #ifndef WITH_LEAN 2207 SOAP_FMAC1 const char* SOAP_FMAC2 soap_wchar2s(struct soap*, const wchar_t*); 2208 SOAP_FMAC1 const char* SOAP_FMAC2 soap_dateTime2s(struct soap*, time_t); 2209 SOAP_FMAC1 const char* SOAP_FMAC2 soap_base642s(struct soap*, const char*, char*, size_t, int*); 2210 SOAP_FMAC1 const char* SOAP_FMAC2 soap_hex2s(struct soap*, const char*, char*, size_t, int*); 2211 #endif 2212 2213 2214 SOAP_FMAC1 int* SOAP_FMAC2 soap_inint(struct soap*, const char *tag, int *p, const char *, int); 2215 SOAP_FMAC1 char* SOAP_FMAC2 soap_inbyte(struct soap*, const char *tag, char *p, const char *, int); 2216 SOAP_FMAC1 long* SOAP_FMAC2 soap_inlong(struct soap*, const char *tag, long *p, const char *, int); 2217 SOAP_FMAC1 LONG64* SOAP_FMAC2 soap_inLONG64(struct soap*, const char *tag, LONG64 *p, const char *, int); 2218 SOAP_FMAC1 short* SOAP_FMAC2 soap_inshort(struct soap*, const char *tag, short *p, const char *, int); 2219 SOAP_FMAC1 float* SOAP_FMAC2 soap_infloat(struct soap*, const char *tag, float *p, const char *, int); 2220 SOAP_FMAC1 double* SOAP_FMAC2 soap_indouble(struct soap*, const char *tag, double *p, const char *, int); 2221 SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_inunsignedByte(struct soap*, const char *tag, unsigned char *p, const char *, int); 2222 SOAP_FMAC1 unsigned short* SOAP_FMAC2 soap_inunsignedShort(struct soap*, const char *tag, unsigned short *p, const char *, int); 2223 SOAP_FMAC1 unsigned int* SOAP_FMAC2 soap_inunsignedInt(struct soap*, const char *tag, unsigned int *p, const char *, int); 2224 SOAP_FMAC1 unsigned long* SOAP_FMAC2 soap_inunsignedLong(struct soap*, const char *tag, unsigned long *p, const char *, int); 2225 SOAP_FMAC1 ULONG64* SOAP_FMAC2 soap_inULONG64(struct soap*, const char *tag, ULONG64 *p, const char *, int); 2226 SOAP_FMAC1 char** SOAP_FMAC2 soap_instring(struct soap*, const char *tag, char **p, const char *, int, int, long, long); 2227 SOAP_FMAC1 char** SOAP_FMAC2 soap_inliteral(struct soap*, const char *tag, char **p); 2228 2229 #ifndef WITH_LEAN 2230 SOAP_FMAC1 time_t* SOAP_FMAC2 soap_indateTime(struct soap*, const char *tag, time_t *p, const char *, int); 2231 SOAP_FMAC1 time_t SOAP_FMAC2 soap_timegm(struct tm*); 2232 #endif 2233 2234 #ifndef WITH_LEANER 2235 SOAP_FMAC1 wchar_t** SOAP_FMAC2 soap_inwstring(struct soap*, const char *tag, wchar_t **p, const char *, int, long, long); 2236 SOAP_FMAC1 wchar_t** SOAP_FMAC2 soap_inwliteral(struct soap*, const char *tag, wchar_t **p); 2237 #endif 2238 2239 SOAP_FMAC1 int SOAP_FMAC2 soap_outbyte(struct soap*, const char *tag, int id, const char *p, const char *, int); 2240 SOAP_FMAC1 int SOAP_FMAC2 soap_outshort(struct soap*, const char *tag, int id, const short *p, const char *, int); 2241 SOAP_FMAC1 int SOAP_FMAC2 soap_outint(struct soap*, const char *tag, int id, const int *p, const char *, int); 2242 SOAP_FMAC1 int SOAP_FMAC2 soap_outlong(struct soap*, const char *tag, int id, const long *p, const char *, int); 2243 SOAP_FMAC1 int SOAP_FMAC2 soap_outLONG64(struct soap*, const char *tag, int id, const LONG64 *p, const char *, int); 2244 SOAP_FMAC1 int SOAP_FMAC2 soap_outfloat(struct soap*, const char *tag, int id, const float *p, const char *, int); 2245 SOAP_FMAC1 int SOAP_FMAC2 soap_outdouble(struct soap*, const char *tag, int id, const double *p, const char *, int); 2246 SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedByte(struct soap*, const char *tag, int id, const unsigned char *p, const char *, int); 2247 SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedShort(struct soap*, const char *tag, int id, const unsigned short *p, const char *, int); 2248 SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedInt(struct soap*, const char *tag, int id, const unsigned int *p, const char *, int); 2249 SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedLong(struct soap*, const char *tag, int id, const unsigned long *p, const char *, int); 2250 SOAP_FMAC1 int SOAP_FMAC2 soap_outULONG64(struct soap*, const char *tag, int id, const ULONG64 *p, const char *, int); 2251 SOAP_FMAC1 int SOAP_FMAC2 soap_outstring(struct soap*, const char *tag, int id, char *const*p, const char *, int); 2252 SOAP_FMAC1 int SOAP_FMAC2 soap_outliteral(struct soap*, const char *tag, char *const*p, const char *type); 2253 2254 #ifndef WITH_LEAN 2255 SOAP_FMAC1 int SOAP_FMAC2 soap_outdateTime(struct soap*, const char *tag, int id, const time_t *p, const char *, int); 2256 #endif 2257 2258 #ifndef WITH_LEANER 2259 SOAP_FMAC1 int SOAP_FMAC2 soap_outwstring(struct soap*, const char *tag, int id, wchar_t *const*p, const char *, int); 2260 SOAP_FMAC1 int SOAP_FMAC2 soap_outwliteral(struct soap*, const char *tag, wchar_t *const*p, const char *type); 2261 #endif 2262 2263 #ifndef WITH_LEANER 2264 SOAP_FMAC1 int SOAP_FMAC2 soap_attachment(struct soap *, const char*, int, const void*, const struct soap_array*, const char*, const char*, const char*, int, const char*, int); 2265 SOAP_FMAC1 int SOAP_FMAC2 soap_move(struct soap*, long); 2266 SOAP_FMAC1 size_t SOAP_FMAC2 soap_tell(struct soap*); 2267 SOAP_FMAC1 char* SOAP_FMAC2 soap_dime_option(struct soap*, unsigned short, const char*); 2268 SOAP_FMAC1 int SOAP_FMAC2 soap_getdimehdr(struct soap*); 2269 SOAP_FMAC1 int SOAP_FMAC2 soap_getdime(struct soap*); 2270 SOAP_FMAC1 int SOAP_FMAC2 soap_putdimehdr(struct soap*); 2271 SOAP_FMAC1 int SOAP_FMAC2 soap_putdime(struct soap*); 2272 SOAP_FMAC1 int SOAP_FMAC2 soap_getmimehdr(struct soap*); 2273 SOAP_FMAC1 int SOAP_FMAC2 soap_getmime(struct soap*); 2274 SOAP_FMAC1 int SOAP_FMAC2 soap_putmimehdr(struct soap*, struct soap_multipart*); 2275 SOAP_FMAC1 int SOAP_FMAC2 soap_putmime(struct soap*); 2276 SOAP_FMAC1 void SOAP_FMAC2 soap_set_dime(struct soap*); 2277 SOAP_FMAC1 void SOAP_FMAC2 soap_set_mime(struct soap*, const char *boundary, const char *start); 2278 SOAP_FMAC1 void SOAP_FMAC2 soap_clr_dime(struct soap*); 2279 SOAP_FMAC1 void SOAP_FMAC2 soap_clr_mime(struct soap*); 2280 SOAP_FMAC1 int SOAP_FMAC2 soap_set_dime_attachment(struct soap*, char *ptr, size_t size, const char *type, const char *id, unsigned short optype, const char *option); 2281 SOAP_FMAC1 int SOAP_FMAC2 soap_set_mime_attachment(struct soap*, char *ptr, size_t size, enum soap_mime_encoding encoding, const char *type, const char *id, const char *location, const char *description); 2282 SOAP_FMAC1 void SOAP_FMAC2 soap_post_check_mime_attachments(struct soap *soap); 2283 SOAP_FMAC1 int SOAP_FMAC2 soap_check_mime_attachments(struct soap *soap); 2284 SOAP_FMAC1 struct soap_multipart* SOAP_FMAC2 soap_get_mime_attachment(struct soap *soap, void *handle); 2285 SOAP_FMAC1 struct soap_multipart* SOAP_FMAC2 soap_next_multipart(struct soap_multipart*); 2286 SOAP_FMAC1 int SOAP_FMAC2 soap_match_cid(struct soap*, const char*, const char*); 2287 #endif 2288 2289 SOAP_FMAC1 int SOAP_FMAC2 soap_register_plugin_arg(struct soap*, int (*fcreate)(struct soap*, struct soap_plugin*, void*), void*); 2290 SOAP_FMAC1 void* SOAP_FMAC2 soap_lookup_plugin(struct soap*, const char*); 2291 2292 SOAP_FMAC1 const char* SOAP_FMAC2 soap_attr_value(struct soap *soap, const char *name, int flag); 2293 SOAP_FMAC1 int SOAP_FMAC2 soap_set_attr(struct soap *soap, const char *name, const char *value); 2294 SOAP_FMAC1 void SOAP_FMAC2 soap_clr_attr(struct soap *soap); 2295 2296 #ifdef WITH_COOKIES 2297 SOAP_FMAC1 void SOAP_FMAC2 soap_getcookies(struct soap *soap, const char *val); 2298 SOAP_FMAC1 size_t SOAP_FMAC2 soap_encode_cookie(const char*, char*, size_t); 2299 SOAP_FMAC1 extern struct soap_cookie* SOAP_FMAC2 soap_set_cookie(struct soap*, const char*, const char*, const char*, const char*); 2300 SOAP_FMAC1 extern struct soap_cookie* SOAP_FMAC2 soap_cookie(struct soap*, const char*, const char*, const char*); 2301 SOAP_FMAC1 extern char* SOAP_FMAC2 soap_cookie_value(struct soap*, const char*, const char*, const char*); 2302 SOAP_FMAC1 extern char* SOAP_FMAC2 soap_env_cookie_value(struct soap*, const char*, const char*, const char*); 2303 SOAP_FMAC1 extern time_t SOAP_FMAC2 soap_cookie_expire(struct soap*, const char*, const char*, const char*); 2304 SOAP_FMAC1 extern int SOAP_FMAC2 soap_set_cookie_expire(struct soap*, const char*, long, const char*, const char*); 2305 SOAP_FMAC1 extern int SOAP_FMAC2 soap_set_cookie_session(struct soap*, const char*, const char*, const char*); 2306 SOAP_FMAC1 extern int SOAP_FMAC2 soap_clr_cookie_session(struct soap*, const char*, const char*, const char*); 2307 SOAP_FMAC1 extern void SOAP_FMAC2 soap_clr_cookie(struct soap*, const char*, const char*, const char*); 2308 SOAP_FMAC1 extern int SOAP_FMAC2 soap_getenv_cookies(struct soap*); 2309 SOAP_FMAC1 extern struct soap_cookie* SOAP_FMAC2 soap_copy_cookies(struct soap*, const struct soap*); 2310 SOAP_FMAC1 extern void SOAP_FMAC2 soap_free_cookies(struct soap*); 2311 #endif 2312 2313 #ifdef __cplusplus 2314 } /* extern "C" */ 2315 #endif 2316 2317 #endif 2318