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