annotate GEMBASSY-1.0.3/gsoap/src/soapcpp2.c @ 1:84a17b3fad1f draft

Uploaded
author ktnyt
date Fri, 26 Jun 2015 05:20:29 -0400
parents 8300eb051bea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
1 /*
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
2 soapcpp2.c
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
3
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
4 Main compiler and code generator batch program.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
5
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
6 gSOAP XML Web services tools
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
7 Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
8 This part of the software is released under one of the following licenses:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
9 GPL or Genivia's license for commercial use.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
10 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
11 GPL license.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
12
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
13 This program is free software; you can redistribute it and/or modify it under
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
14 the terms of the GNU General Public License as published by the Free Software
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
15 Foundation; either version 2 of the License, or (at your option) any later
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
16 version.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
17
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
18 This program is distributed in the hope that it will be useful, but WITHOUT ANY
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
19 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
20 PARTICULAR PURPOSE. See the GNU General Public License for more details.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
21
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
22 You should have received a copy of the GNU General Public License along with
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
23 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
24 Place, Suite 330, Boston, MA 02111-1307 USA
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
25
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
26 Author contact information:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
27 engelen@genivia.com / engelen@acm.org
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
28
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
29 This program is released under the GPL with the additional exemption that
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
30 compiling, linking, and/or using OpenSSL is allowed.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
31 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
32 A commercial use license is available from Genivia, Inc., contact@genivia.com
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
33 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
34 */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
35
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
36 #include "soapcpp2.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
37
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
38 #ifndef SOAPCPP2_IMPORT_PATH
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
39 #define SOAPCPP2_IMPORT_PATH (NULL)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
40 #endif
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
41
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
42 extern void init(void);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
43 extern int yyparse(void);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
44 extern FILE *yyin;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
45
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
46 extern char *ns_cname(char*, char*);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
47
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
48 FILE *fmsg; /* fd to flush compiler messages */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
49
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
50 int vflag = 0; /* SOAP version, -1=no SOAP, 0=not set, 1=1.1, 2=1.2 */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
51 int wflag = 0; /* when set, don't generate WSDL and schema files */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
52 int Cflag = 0; /* when set, generate only files for clients */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
53 int cflag = 0; /* when set, generate files with .c extension */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
54 int aflag = 0; /* when set, use value of SOAP Action to dispatch method at server side */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
55 int Aflag = 0; /* when set, require SOAP Action to dispatch method at server side */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
56 int bflag = 0; /* when set, serialize byte arrays char[N] as string */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
57 int eflag = 0; /* when set, use SOAP RPC encoding by default */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
58 unsigned long fflag = 0;/* multi-file split for each bundle of -fN defs */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
59 int iflag = 0; /* when set, generate new style proxy/object classes inherited from soap struct */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
60 int jflag = 0; /* when set, generate new style proxy/object classes */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
61 int kflag = 0; /* when set, generate data traversal/walker routines */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
62 int mflag = 0; /* when set, generate code that requires array/binary classes to explicitly remove malloced array */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
63 int nflag = 0; /* when set, names the namespaces global struct '%NAME%_namespaces */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
64 int lflag = 0; /* when set, create library */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
65 int Lflag = 0; /* when set, don't generate soapClientLib/soapServerLib */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
66 int Qflag = 0; /* when set, use C++ namespaces for custom serializers */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
67 int sflag = 0; /* when set, generate strict validation checks */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
68 int Sflag = 0; /* when set, generate only files for servers */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
69 int Tflag = 0; /* when set, generates server auto-test code */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
70 int tflag = 0; /* when set, generates typed messsages (with xsi:type attributes) */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
71 int uflag = 0; /* when set, uncomment WSDL and schema output */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
72 int xflag = 0; /* when set, don't generate sample XML message files */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
73 int yflag = 0; /* when set, add C/C++ info in sample XML messages */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
74 int zflag = 0; /* when set, use backward compatibility option */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
75
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
76 int stop_flag = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
77
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
78 char dirpath[1024]; /* directory path for generated source files */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
79 char *prefix = "soap"; /* file name prefix for generated source files */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
80 char filename[1024]; /* current file name */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
81 char *importpath = SOAPCPP2_IMPORT_PATH; /* default file import path */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
82
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
83 /*
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
84 IMPORTANT:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
85
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
86 The terms and conditions of use of this software do not allow for the removal
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
87 of the copyright notice from the main program for visual display. For
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
88 integrations with other software, a similar copyright notice must be produced
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
89 that is visible to users of the software.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
90 */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
91
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
92 int
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
93 main(int argc, char **argv)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
94 { int i, g;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
95 char *a, *s;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
96 fmsg = stderr;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
97 strcpy(filename, "<stdin>");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
98 for (i = 1; i < argc; i++)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
99 { a = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
100 if (*a == '-'
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
101 #ifdef WIN32
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
102 || *a == '/'
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
103 #endif
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
104 )
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
105 { g = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
106 while (g && *++a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
107 switch (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
108 { case 'C':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
109 Cflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
110 if (Sflag)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
111 fprintf(stderr, "soapcpp2: using both options -C and -S omits client/server code\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
112 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
113 case 'c':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
114 cflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
115 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
116 case 'd':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
117 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
118 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
119 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
120 strcpy(dirpath, a);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
121 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
122 strcpy(dirpath, argv[i]);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
123 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
124 execerror("Option -d requires a directory path");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
125 if (*dirpath && dirpath[strlen(dirpath)-1] != '/' && dirpath[strlen(dirpath)-1] != '\\')
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
126 strcat(dirpath, SOAP_PATHCAT);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
127 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
128 case 'e':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
129 eflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
130 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
131 case 'f':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
132 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
133 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
134 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
135 fflag = strtoul(a, NULL, 10);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
136 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
137 fflag = strtoul(argv[i], NULL, 10);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
138 if (!fflag)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
139 execerror("Option -f requires a value");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
140 if (fflag < 10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
141 fflag = 10;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
142 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
143 case 'a':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
144 aflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
145 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
146 case 'A':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
147 aflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
148 Aflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
149 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
150 case 'b':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
151 bflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
152 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
153 case '?':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
154 case 'h':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
155 fprintf(stderr, "Usage: soapcpp2 [-0|-1|-2] [-C|-S] [-T] [-L] [-a] [-A] [-b] [-c] [-d path] [-e] [-f N] [-h] [-i] [-I path"SOAP_PATHSEP"path"SOAP_PATHSEP"...] [-k] [-l] [-m] [-n] [-p name] [-s] [-t] [-u] [-v] [-w] [-x] [-y] [-z#] [infile]\n\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
156 fprintf(stderr, "\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
157 -1 generate SOAP 1.1 bindings\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
158 -2 generate SOAP 1.2 bindings\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
159 -0 remove SOAP bindings, use REST\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
160 -C generate client-side code only\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
161 -S generate server-side code only\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
162 -T generate server auto-test code\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
163 -L don't generate soapClientLib/soapServerLib\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
164 -a use SOAPAction with WS-Addressing to invoke server-side operations\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
165 -A require SOAPAction to invoke server-side operations\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
166 -b serialize byte arrays char[N] as string\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
167 -c generate C source code\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
168 -dpath use path to save files\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
169 -e generate SOAP RPC encoding style bindings\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
170 -fN file split of N XML serializer implementations per file (N>=10)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
171 -h display help info\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
172 -Ipath use path(s) for #import (paths separated with '"SOAP_PATHSEP"')\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
173 -i generate C++ service proxies and objects inherited from soap struct\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
174 -j generate C++ service proxies and objects that share a soap struct\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
175 -k generate data structure walkers (experimental)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
176 -l generate linkable modules (experimental)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
177 -m generate Matlab(tm) code for MEX compiler\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
178 -n use service name to rename service functions and namespace table\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
179 -pname save files with new prefix name instead of 'soap'\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
180 -Qname use name as the C++ namespace for decls, including custom serializers\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
181 -qname use name as the C++ namespace for decls, excluding custom serializers\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
182 -s generate deserialization code with strict XML validation checks\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
183 -t generate code for fully xsi:type typed SOAP/XML messaging\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
184 -u uncomment comments in WSDL/schema output by suppressing XML comments\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
185 -v display version info\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
186 -w don't generate WSDL and schema files\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
187 -x don't generate sample XML message files\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
188 -y include C/C++ type access information in sample XML messages\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
189 -z1 generate deprecated old-style C++ service proxies and objects\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
190 infile header file to parse (or stdin)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
191 \n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
192 exit(0);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
193 case 'I':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
194 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
195 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
196 s = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
197 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
198 s = a;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
199 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
200 s = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
201 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
202 execerror("Option -I requires an import path");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
203 if (importpath && s)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
204 { char *t = emalloc(strlen(importpath) + strlen(s) + 2);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
205 strcpy(t, importpath);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
206 strcat(t, SOAP_PATHSEP);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
207 strcat(t, s);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
208 importpath = t;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
209 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
210 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
211 importpath = s;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
212 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
213 case 'i':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
214 iflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
215 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
216 case 'j':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
217 jflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
218 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
219 case 'k':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
220 kflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
221 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
222 case 'm':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
223 mflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
224 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
225 case 'n':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
226 nflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
227 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
228 case 'l':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
229 lflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
230 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
231 case 'L':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
232 Lflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
233 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
234 case 's':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
235 sflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
236 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
237 case 'S':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
238 Sflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
239 if (Cflag)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
240 fprintf(stderr, "soapcpp2: using both options -C and -S omits client/server code\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
241 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
242 case 'T':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
243 Tflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
244 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
245 case 't':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
246 tflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
247 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
248 case 'u':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
249 uflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
250 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
251 case 'w':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
252 wflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
253 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
254 case 'x':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
255 xflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
256 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
257 case 'y':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
258 yflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
259 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
260 case 'p':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
261 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
262 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
263 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
264 prefix = ns_cname(a, NULL);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
265 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
266 prefix = ns_cname(argv[i], NULL);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
267 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
268 execerror("Option -p requires an output file name prefix");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
269 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
270 case 'Q':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
271 Qflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
272 /* fall through */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
273 case 'q':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
274 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
275 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
276 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
277 namespaceid = ns_cname(a, NULL);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
278 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
279 namespaceid = ns_cname(argv[i], NULL);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
280 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
281 execerror("Option -q requires a namespace name");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
282 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
283 case '0':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
284 vflag = -1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
285 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
286 case '1':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
287 vflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
288 envURI = "http://schemas.xmlsoap.org/soap/envelope/";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
289 encURI = "http://schemas.xmlsoap.org/soap/encoding/";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
290 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
291 case '2':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
292 vflag = 2;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
293 envURI = "http://www.w3.org/2003/05/soap-envelope";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
294 encURI = "http://www.w3.org/2003/05/soap-encoding";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
295 rpcURI = "http://www.w3.org/2003/05/soap-rpc";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
296 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
297 case 'v':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
298 stop_flag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
299 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
300 case 'z':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
301 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
302 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
303 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
304 zflag = *a - '0';
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
305 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
306 zflag = *argv[i] - '0';
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
307 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
308 execerror("Option -z requires a digit");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
309 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
310 default:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
311 fprintf(stderr, "soapcpp2: Unknown option %s\n", a);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
312 exit(1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
313 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
314 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
315 else if (!(yyin = fopen(argv[i], "r")))
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
316 { sprintf(errbuf, "Cannot open file \"%s\" for reading", argv[i]);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
317 execerror(errbuf);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
318 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
319 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
320 strcpy(filename, argv[i]);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
321 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
322 fprintf(fmsg, "\n** The gSOAP code generator for C and C++, soapcpp2 release "VERSION"\n** Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc.\n** All Rights Reserved. This product is provided \"as is\", without any warranty.\n** The soapcpp2 tool is released under one of the following licenses:\n** GPL or the commercial license by Genivia Inc.\n\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
323 if (stop_flag)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
324 exit(0);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
325 init();
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
326 if (yyparse())
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
327 synerror("skipping the remaining part of the input");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
328 return errstat();
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
329 }