108 {
109 int hflag, nflag, gflag, fflag, dflag, uflag;
110 long i;
111 int n;
112 int sec;
115 char initials[3] = " ";
116 char *s = (char*) NULL;
117 char *command = (char*) NULL;
118 char *generic_name = (char*) NULL;
119 struct tm *tminfo;
121 if ('X' == buffer[0]) {
122 buffer[0] = 'V';
123 (void) fprintf(
STDERR,
"\n\n **** *************************************************************\n");
124 (void) fprintf(
STDERR,
" **** *** BETA RELEASE of NAPA %-6s ***\n", buffer);
125 (void) fprintf(
STDERR,
" **** *** Contact Yves Leduc, yves.leduc.be@gmail.com ***\n");
126 (void) fprintf(
STDERR,
" **** *** to get a stable release. ***\n");
127 (void) fprintf(
STDERR,
" **** *************************************************************\n\n");
128 }
132 dflag = false;
133 fflag = false;
134 gflag = false;
135 hflag = false;
136 nflag = false;
137 uflag = false;
141 for (i = 1L; i < c; i++) {
144 }
145 c--;
146 v++;
147 if (0L == c) {
149 n = snprintf(str, (size_t) 159, "Type %s -help to get a short usage", command);
150 (void) fprintf(
STDERR,
"\n*** %s %*s ***\n", str, 64 -n,
" ");
151 (void) fprintf(
STDERR,
"\nContact the author Yves Leduc (Email: yves.leduc.be@gmail.com) for further information.\n");
152 exit(EXIT_SUCCESS);
153 }
154 while (0L < c) {
156 c--;
157 v++;
158 if (0L >= c) {
159 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-h, -hdr]: header library pathname is missing.\n");
161 exit(EXIT_FAILURE);
162 }
164 c--;
165 v++;
166 if (!hflag) {
167 hflag = true;
168 } else {
169 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-h, -hdr]: only one header library pathname is allowed.\n");
170 exit(EXIT_FAILURE);
171 }
173 c--;
174 v++;
175 if (0L >= c) {
176 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-n, -net]: net library pathname is missing.\n");
178 exit(EXIT_FAILURE);
179 }
181 c--;
182 v++;
183 if (!nflag) {
184 nflag = true;
185 } else {
186 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-n, -net]: only one net library pathname is allowed.\n");
187 exit(EXIT_FAILURE);
188 }
190 c--;
191 v++;
192 if (0L >= c) {
193 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-g, -gen]: generator library pathname is missing.\n");
195 exit(EXIT_FAILURE);
196 }
198 c--;
199 v++;
200 if (!gflag) {
201 gflag = true;
202 } else {
203 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-g, -gen]: only one generator pathname library is allowed.\n");
204 exit(EXIT_FAILURE);
205 }
207 c--;
208 v++;
209 if (0L >= c) {
210 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-d, -dir]: generic library pathname is missing.\n");
212 exit(EXIT_FAILURE);
213 }
215 c--;
216 v++;
217 if (!dflag) {
218 dflag = true;
219 } else {
220 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-d, -dir]: only one generic library pathname library is allowed.\n");
221 exit(EXIT_FAILURE);
222 }
224 c--;
225 v++;
226 if (0L >= c) {
227 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-u, -user]: user name is missing.\n");
229 exit(EXIT_FAILURE);
230 }
235 }
238 continue;
239 }
240 }
246 if (' ' == initials[1]) {
248 }
249 }
250 }
251 c--;
252 v++;
253 if (!uflag) {
254 uflag = true;
255 } else {
256 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-u, -user]: only one user name is allowed.\n");
257 exit(EXIT_FAILURE);
258 }
260 c--;
261 v++;
264 } else {
265 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-e, -expand]:");
266 (void) fprintf(
STDERR,
" file expansion and nodes/variables listing are not possible together.\n");
268 exit(EXIT_FAILURE);
269 }
271 c--;
272 v++;
275 } else {
276 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: [-l, -list]:");
277 (void) fprintf(
STDERR,
" nodes/variables listing and file expansion are not possible together.\n");
279 exit(EXIT_FAILURE);
280 }
282 c--;
283 v++;
285 (void) fprintf(
STDERR,
"\n");
287 (void) fprintf(
STDERR,
"\n");
290 (void) fprintf(
STDERR,
"\n*** AUTHOR: Yves Leduc (Email: yves.leduc.be@gmail.com) ***\n");
291 exit(EXIT_SUCCESS);
294 exit(EXIT_SUCCESS);
297 exit(EXIT_SUCCESS);
298 } else if ('-' == **v) {
299 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: option '%s' is not recognized as a valid option.\n", *v);
301 exit(EXIT_FAILURE);
302 } else {
304#if (IS_WIN64 == PLATFORM)
308 }
309 }
310#endif
314 }
315 c--;
316 v++;
317 if (!fflag) {
318 fflag = true;
319 } else {
320 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: only one main source file pathname is allowed.\n");
321 exit(EXIT_FAILURE);
322 }
323 }
324 }
325 if (!fflag) {
326 (void) fprintf(
STDERR,
"\nNAPA Command Line Error: main source file pathname is missing.\n");
328 exit(EXIT_FAILURE);
329 }
330 if ((!hflag) && (dflag)) {
331 (void) snprintf(buffer, (
size_t) (
STRLENGTH-1L),
"%s/Hdr", generic_name);
333 }
334 if ((!nflag) && (dflag)) {
335 (void) snprintf(buffer, (
size_t) (
STRLENGTH-1L),
"%s/Net", generic_name);
337 }
338 if ((!gflag) && (dflag)) {
339 (void) snprintf(buffer, (
size_t) (
STRLENGTH-1L),
"%s/Gen", generic_name);
341 }
342 if ((!hflag) && (!dflag)) {
344 }
345 if ((!nflag) && (!dflag)) {
347 }
348 if ((!gflag) && (!dflag)) {
350 }
353 }
354 free(command);
355 if ((dflag) || (NULL != generic_name)) {
356 free(generic_name);
357 }
359 sec = ((*tminfo).tm_mday * 86400) + ((*tminfo).tm_hour * 3600) + ((*tminfo).tm_min * 60) + (*tminfo).tm_sec;
360 (void) snprintf(buffer, (size_t) 16, "%d%d%d", (*tminfo).tm_year-100, (*tminfo).tm_mon+1, sec);
361 if (0 == strcmp(initials, " ")) {
362 (void) snprintf(
NAPA_Job_ID, (
size_t) 16,
"%s", buffer);
363 } else {
364 (void) snprintf(
NAPA_Job_ID, (
size_t) 18,
"%s%s", initials, buffer);
365 }
366 return;
367}
void print_usage(const char *command)
void print_identification(void)
void print_build_information(void)
void strcpy_alloc(char **dest, const char *sour, const unsigned long *mlin, const unsigned long *mfil)
void strcpy_realloc(char **dest, const char *sour, const unsigned long *mlin, const unsigned long *mfil)
EXTERN char * Generator_Lib_Name
EXTERN char NAPA_Compile_Time[33]
EXTERN char NAPA_Command_Line[2047L]
EXTERN char NAPA_Job_ID[19]
EXTERN char * Header_Lib_Name
EXTERN char * Main_File_Name
EXTERN char * Net_Lib_Name
void drop_pathname(char *pnam)