~ubuntu-branches/ubuntu/maverick/krb5/maverick

« back to all changes in this revision

Viewing changes to src/util/makedepend/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2009-05-07 16:16:34 UTC
  • mfrom: (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090507161634-xqyk0s9na0le4flj
Tags: 1.7dfsg~beta1-4
When  decrypting the TGS response fails with the subkey, try with the
session key to work around Heimdal bug, Closes: #527353 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $XConsortium: main.c,v 1.83 94/04/17 20:10:36 gildea Exp $ */
2
 
/*
3
 
 
4
 
Copyright (c) 1993, 1994  X Consortium
5
 
 
6
 
Permission is hereby granted, free of charge, to any person obtaining a copy
7
 
of this software and associated documentation files (the "Software"), to deal
8
 
in the Software without restriction, including without limitation the rights
9
 
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
 
copies of the Software, and to permit persons to whom the Software is
11
 
furnished to do so, subject to the following conditions:
12
 
 
13
 
The above copyright notice and this permission notice shall be included in
14
 
all copies or substantial portions of the Software.
15
 
 
16
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
19
 
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20
 
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
 
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
 
 
23
 
Except as contained in this notice, the name of the X Consortium shall not be
24
 
used in advertising or otherwise to promote the sale, use or other dealings
25
 
in this Software without prior written authorization from the X Consortium.
26
 
 
27
 
*/
28
 
 
29
 
#include "def.h"
30
 
#ifdef hpux
31
 
#define sigvec sigvector
32
 
#endif /* hpux */
33
 
 
34
 
#include <signal.h>
35
 
 
36
 
#if NeedVarargsPrototypes
37
 
#include <stdarg.h>
38
 
#endif
39
 
 
40
 
#ifdef DEBUG
41
 
int     _debugmask;
42
 
#endif
43
 
 
44
 
char *ProgramName;
45
 
 
46
 
char    *directives[] = {
47
 
        "if",
48
 
        "ifdef",
49
 
        "ifndef",
50
 
        "else",
51
 
        "endif",
52
 
        "define",
53
 
        "undef",
54
 
        "include",
55
 
        "line",
56
 
        "pragma",
57
 
        "error",
58
 
        "ident",
59
 
        "sccs",
60
 
        "elif",
61
 
        "eject",
62
 
        NULL
63
 
};
64
 
 
65
 
#define MAKEDEPEND
66
 
#include "imakemdep.h"  /* from config sources */
67
 
#undef MAKEDEPEND
68
 
 
69
 
struct  inclist inclist[ MAXFILES ],
70
 
                *inclistp = inclist,
71
 
                maininclist;
72
 
 
73
 
char    *filelist[ MAXFILES ];
74
 
char    *includedirs[ MAXDIRS + 1 ];
75
 
char    *notdotdot[ MAXDIRS ];
76
 
char    *objprefix = "";
77
 
char    *objsuffix = OBJSUFFIX;
78
 
char    *startat = "# DO NOT DELETE";
79
 
int     width = 78;
80
 
boolean append = FALSE;
81
 
boolean printed = FALSE;
82
 
boolean verbose = FALSE;
83
 
boolean show_where_not = FALSE;
84
 
boolean warn_multiple = FALSE;  /* Warn on multiple includes of same file */
85
 
 
86
 
static
87
 
#ifdef SIGNALRETURNSINT
88
 
int
89
 
#else
90
 
void
91
 
#endif
92
 
catch (sig)
93
 
    int sig;
94
 
{
95
 
        fflush (stdout);
96
 
        fatalerr ("got signal %d\n", sig);
97
 
}
98
 
 
99
 
#if defined(USG) || (defined(SYSV386) && defined(SYSV)) || defined(WIN32)
100
 
#define USGISH
101
 
#endif
102
 
 
103
 
#ifndef USGISH
104
 
#ifndef _POSIX_SOURCE
105
 
#define sigaction sigvec
106
 
#define sa_handler sv_handler
107
 
#define sa_mask sv_mask
108
 
#define sa_flags sv_flags
109
 
#endif
110
 
struct sigaction sig_act;
111
 
#endif /* USGISH */
112
 
 
113
 
main(argc, argv)
114
 
        int     argc;
115
 
        char    **argv;
116
 
{
117
 
        register char   **fp = filelist;
118
 
        register char   **incp = includedirs;
119
 
        register char   *p;
120
 
        register struct inclist *ip;
121
 
        char    *makefile = NULL;
122
 
        struct filepointer      *filecontent;
123
 
        struct symtab *psymp = predefs;
124
 
        char *endmarker = NULL;
125
 
        char *defincdir = NULL;
126
 
 
127
 
        ProgramName = argv[0];
128
 
 
129
 
        while (psymp->s_name)
130
 
        {
131
 
            define2(psymp->s_name, psymp->s_value, &maininclist);
132
 
            psymp++;
133
 
        }
134
 
        if (argc == 2 && argv[1][0] == '@') {
135
 
            struct stat ast;
136
 
            int afd;
137
 
            char *args;
138
 
            char **nargv;
139
 
            int nargc;
140
 
            char quotechar = '\0';
141
 
 
142
 
            nargc = 1;
143
 
            if ((afd = open(argv[1]+1, O_RDONLY)) < 0)
144
 
                fatalerr("cannot open \"%s\"\n", argv[1]+1);
145
 
            fstat(afd, &ast);
146
 
            args = (char *)malloc(ast.st_size + 1);
147
 
            if ((ast.st_size = read(afd, args, ast.st_size)) < 0)
148
 
                fatalerr("failed to read %s\n", argv[1]+1);
149
 
            args[ast.st_size] = '\0';
150
 
            close(afd);
151
 
            for (p = args; *p; p++) {
152
 
                if (quotechar) {
153
 
                    if (quotechar == '\\' ||
154
 
                        (*p == quotechar && p[-1] != '\\'))
155
 
                        quotechar = '\0';
156
 
                    continue;
157
 
                }
158
 
                switch (*p) {
159
 
                case '\\':
160
 
                case '"':
161
 
                case '\'':
162
 
                    quotechar = *p;
163
 
                    break;
164
 
                case ' ':
165
 
                case '\n':
166
 
                    *p = '\0';
167
 
                    if (p > args && p[-1])
168
 
                        nargc++;
169
 
                    break;
170
 
                }
171
 
            }
172
 
            if (p[-1])
173
 
                nargc++;
174
 
            nargv = (char **)malloc(nargc * sizeof(char *));
175
 
            nargv[0] = argv[0];
176
 
            argc = 1;
177
 
            for (p = args; argc < nargc; p += strlen(p) + 1)
178
 
                if (*p) nargv[argc++] = p;
179
 
            argv = nargv;
180
 
        }
181
 
        for(argc--, argv++; argc; argc--, argv++) {
182
 
                /* if looking for endmarker then check before parsing */
183
 
                if (endmarker && strcmp (endmarker, *argv) == 0) {
184
 
                    endmarker = NULL;
185
 
                    continue;
186
 
                }
187
 
                if (**argv != '-') {
188
 
                        /* treat +thing as an option for C++ */
189
 
                        if (endmarker && **argv == '+')
190
 
                                continue;
191
 
                        *fp++ = argv[0];
192
 
                        continue;
193
 
                }
194
 
                switch(argv[0][1]) {
195
 
                case '-':
196
 
                        endmarker = &argv[0][2];
197
 
                        if (endmarker[0] == '\0') endmarker = "--";
198
 
                        break;
199
 
                case 'D':
200
 
                        if (argv[0][2] == '\0') {
201
 
                                argv++;
202
 
                                argc--;
203
 
                        }
204
 
                        for (p=argv[0] + 2; *p ; p++)
205
 
                                if (*p == '=') {
206
 
                                        *p = ' ';
207
 
                                        break;
208
 
                                }
209
 
                        define(argv[0] + 2, &maininclist);
210
 
                        break;
211
 
                case 'I':
212
 
                        if (incp >= includedirs + MAXDIRS)
213
 
                            fatalerr("Too many -I flags.\n");
214
 
                        *incp++ = argv[0]+2;
215
 
                        if (**(incp-1) == '\0') {
216
 
                                *(incp-1) = *(++argv);
217
 
                                argc--;
218
 
                        }
219
 
                        break;
220
 
                case 'Y':
221
 
                        defincdir = argv[0]+2;
222
 
                        break;
223
 
                /* do not use if endmarker processing */
224
 
                case 'a':
225
 
                        if (endmarker) break;
226
 
                        append = TRUE;
227
 
                        break;
228
 
                case 'w':
229
 
                        if (endmarker) break;
230
 
                        if (argv[0][2] == '\0') {
231
 
                                argv++;
232
 
                                argc--;
233
 
                                width = atoi(argv[0]);
234
 
                        } else
235
 
                                width = atoi(argv[0]+2);
236
 
                        break;
237
 
                case 'o':
238
 
                        if (endmarker) break;
239
 
                        if (argv[0][2] == '\0') {
240
 
                                argv++;
241
 
                                argc--;
242
 
                                objsuffix = argv[0];
243
 
                        } else
244
 
                                objsuffix = argv[0]+2;
245
 
                        break;
246
 
                case 'p':
247
 
                        if (endmarker) break;
248
 
                        if (argv[0][2] == '\0') {
249
 
                                argv++;
250
 
                                argc--;
251
 
                                objprefix = argv[0];
252
 
                        } else
253
 
                                objprefix = argv[0]+2;
254
 
                        break;
255
 
                case 'v':
256
 
                        if (endmarker) break;
257
 
                        verbose = TRUE;
258
 
#ifdef DEBUG
259
 
                        if (argv[0][2])
260
 
                                _debugmask = atoi(argv[0]+2);
261
 
#endif
262
 
                        break;
263
 
                case 's':
264
 
                        if (endmarker) break;
265
 
                        startat = argv[0]+2;
266
 
                        if (*startat == '\0') {
267
 
                                startat = *(++argv);
268
 
                                argc--;
269
 
                        }
270
 
                        if (*startat != '#')
271
 
                                fatalerr("-s flag's value should start %s\n",
272
 
                                        "with '#'.");
273
 
                        break;
274
 
                case 'f':
275
 
                        if (endmarker) break;
276
 
                        makefile = argv[0]+2;
277
 
                        if (*makefile == '\0') {
278
 
                                makefile = *(++argv);
279
 
                                argc--;
280
 
                        }
281
 
                        break;
282
 
 
283
 
                case 'm':
284
 
                        warn_multiple = TRUE;
285
 
                        break;
286
 
                        
287
 
                /* Ignore -O, -g so we can just pass ${CFLAGS} to
288
 
                   makedepend
289
 
                 */
290
 
                case 'O':
291
 
                case 'g':
292
 
                        break;
293
 
                default:
294
 
                        if (endmarker) break;
295
 
        /*              fatalerr("unknown opt = %s\n", argv[0]); */
296
 
                        warning("ignoring option %s\n", argv[0]);
297
 
                }
298
 
        }
299
 
        if (!defincdir) {
300
 
#ifdef PREINCDIR
301
 
            if (incp >= includedirs + MAXDIRS)
302
 
                fatalerr("Too many -I flags.\n");
303
 
            *incp++ = PREINCDIR;
304
 
#endif
305
 
            if (incp >= includedirs + MAXDIRS)
306
 
                fatalerr("Too many -I flags.\n");
307
 
            *incp++ = INCLUDEDIR;
308
 
#ifdef POSTINCDIR
309
 
            if (incp >= includedirs + MAXDIRS)
310
 
                fatalerr("Too many -I flags.\n");
311
 
            *incp++ = POSTINCDIR;
312
 
#endif
313
 
        } else if (*defincdir) {
314
 
            if (incp >= includedirs + MAXDIRS)
315
 
                fatalerr("Too many -I flags.\n");
316
 
            *incp++ = defincdir;
317
 
        }
318
 
 
319
 
        redirect(startat, makefile);
320
 
 
321
 
        /*
322
 
         * catch signals.
323
 
         */
324
 
#ifdef USGISH
325
 
/*  should really reset SIGINT to SIG_IGN if it was.  */
326
 
#ifdef SIGHUP
327
 
        signal (SIGHUP, catch);
328
 
#endif
329
 
        signal (SIGINT, catch);
330
 
#ifdef SIGQUIT
331
 
        signal (SIGQUIT, catch);
332
 
#endif
333
 
        signal (SIGILL, catch);
334
 
#ifdef SIGBUS
335
 
        signal (SIGBUS, catch);
336
 
#endif
337
 
        signal (SIGSEGV, catch);
338
 
#ifdef SIGSYS
339
 
        signal (SIGSYS, catch);
340
 
#endif
341
 
#else
342
 
        sig_act.sa_handler = catch;
343
 
#ifdef _POSIX_SOURCE
344
 
        sigemptyset(&sig_act.sa_mask);
345
 
        sigaddset(&sig_act.sa_mask, SIGINT);
346
 
        sigaddset(&sig_act.sa_mask, SIGQUIT);
347
 
#ifdef SIGBUS
348
 
        sigaddset(&sig_act.sa_mask, SIGBUS);
349
 
#endif
350
 
        sigaddset(&sig_act.sa_mask, SIGILL);
351
 
        sigaddset(&sig_act.sa_mask, SIGSEGV);
352
 
        sigaddset(&sig_act.sa_mask, SIGHUP);
353
 
        sigaddset(&sig_act.sa_mask, SIGPIPE);
354
 
#ifdef SIGSYS
355
 
        sigaddset(&sig_act.sa_mask, SIGSYS);
356
 
#endif
357
 
#else
358
 
        sig_act.sa_mask = ((1<<(SIGINT -1))
359
 
                           |(1<<(SIGQUIT-1))
360
 
#ifdef SIGBUS
361
 
                           |(1<<(SIGBUS-1))
362
 
#endif
363
 
                           |(1<<(SIGILL-1))
364
 
                           |(1<<(SIGSEGV-1))
365
 
                           |(1<<(SIGHUP-1))
366
 
                           |(1<<(SIGPIPE-1))
367
 
#ifdef SIGSYS
368
 
                           |(1<<(SIGSYS-1))
369
 
#endif
370
 
                           );
371
 
#endif /* _POSIX_SOURCE */
372
 
        sig_act.sa_flags = 0;
373
 
        sigaction(SIGHUP, &sig_act, (struct sigaction *)0);
374
 
        sigaction(SIGINT, &sig_act, (struct sigaction *)0);
375
 
        sigaction(SIGQUIT, &sig_act, (struct sigaction *)0);
376
 
        sigaction(SIGILL, &sig_act, (struct sigaction *)0);
377
 
#ifdef SIGBUS
378
 
        sigaction(SIGBUS, &sig_act, (struct sigaction *)0);
379
 
#endif
380
 
        sigaction(SIGSEGV, &sig_act, (struct sigaction *)0);
381
 
#ifdef SIGSYS
382
 
        sigaction(SIGSYS, &sig_act, (struct sigaction *)0);
383
 
#endif
384
 
#endif /* USGISH */
385
 
 
386
 
        /*
387
 
         * now peruse through the list of files.
388
 
         */
389
 
        for(fp=filelist; *fp; fp++) {
390
 
                filecontent = getfile(*fp);
391
 
                ip = newinclude(*fp, (char *)NULL);
392
 
 
393
 
                find_includes(filecontent, ip, ip, 0, FALSE);
394
 
                freefile(filecontent);
395
 
                recursive_pr_include(ip, ip->i_file, base_name(*fp));
396
 
                inc_clean();
397
 
        }
398
 
        if (printed)
399
 
                printf("\n");
400
 
        exit(0);
401
 
}
402
 
 
403
 
struct filepointer *getfile(file)
404
 
        char    *file;
405
 
{
406
 
        register int    fd;
407
 
        struct filepointer      *content;
408
 
        struct stat     st;
409
 
 
410
 
        content = (struct filepointer *)malloc(sizeof(struct filepointer));
411
 
        if ((fd = open(file, O_RDONLY)) < 0) {
412
 
                warning("cannot open \"%s\"\n", file);
413
 
                content->f_p = content->f_base = content->f_end = (char *)malloc(1);
414
 
                *content->f_p = '\0';
415
 
                return(content);
416
 
        }
417
 
        fstat(fd, &st);
418
 
        content->f_base = (char *)malloc(st.st_size+1);
419
 
        if (content->f_base == NULL)
420
 
                fatalerr("cannot allocate mem\n");
421
 
        if ((st.st_size = read(fd, content->f_base, st.st_size)) < 0)
422
 
                fatalerr("failed to read %s\n", file);
423
 
        close(fd);
424
 
        content->f_len = st.st_size+1;
425
 
        content->f_p = content->f_base;
426
 
        content->f_end = content->f_base + st.st_size;
427
 
        *content->f_end = '\0';
428
 
        content->f_line = 0;
429
 
        return(content);
430
 
}
431
 
 
432
 
freefile(fp)
433
 
        struct filepointer      *fp;
434
 
{
435
 
        free(fp->f_base);
436
 
        free(fp);
437
 
}
438
 
 
439
 
char *copy(str)
440
 
        register char   *str;
441
 
{
442
 
        register char   *p = (char *)malloc(strlen(str) + 1);
443
 
 
444
 
        strcpy(p, str);
445
 
        return(p);
446
 
}
447
 
 
448
 
match(str, list)
449
 
        register char   *str, **list;
450
 
{
451
 
        register int    i;
452
 
 
453
 
        for (i=0; *list; i++, list++)
454
 
                if (strcmp(str, *list) == 0)
455
 
                        return(i);
456
 
        return(-1);
457
 
}
458
 
 
459
 
/*
460
 
 * Get the next line.  We only return lines beginning with '#' since that
461
 
 * is all this program is ever interested in.
462
 
 */
463
 
char *getline(filep)
464
 
        register struct filepointer     *filep;
465
 
{
466
 
        register char   *p,     /* walking pointer */
467
 
                        *eof,   /* end of file pointer */
468
 
                        *bol;   /* beginning of line pointer */
469
 
        register        lineno; /* line number */
470
 
 
471
 
        p = filep->f_p;
472
 
        eof = filep->f_end;
473
 
        if (p >= eof)
474
 
                return((char *)NULL);
475
 
        lineno = filep->f_line;
476
 
 
477
 
        for(bol = p--; ++p < eof; ) {
478
 
                if (*p == '/' && *(p+1) == '*') { /* consume comments */
479
 
                        *p++ = ' ', *p++ = ' ';
480
 
                        while (*p) {
481
 
                                if (*p == '*' && *(p+1) == '/') {
482
 
                                        *p++ = ' ', *p = ' ';
483
 
                                        break;
484
 
                                }
485
 
                                else if (*p == '\n')
486
 
                                        lineno++;
487
 
                                *p++ = ' ';
488
 
                        }
489
 
                        continue;
490
 
                }
491
 
#ifdef WIN32
492
 
                else if (*p == '/' && *(p+1) == '/') { /* consume comments */
493
 
                        *p++ = ' ', *p++ = ' ';
494
 
                        while (*p && *p != '\n')
495
 
                                *p++ = ' ';
496
 
                        lineno++;
497
 
                        continue;
498
 
                }
499
 
#endif
500
 
                else if (*p == '\\') {
501
 
                        if (*(p+1) == '\n') {
502
 
                                *p = ' ';
503
 
                                *(p+1) = ' ';
504
 
                                lineno++;
505
 
                        }
506
 
                }
507
 
                else if (*p == '\n') {
508
 
                        lineno++;
509
 
                        if (*bol == '#') {
510
 
                                register char *cp;
511
 
 
512
 
                                *p++ = '\0';
513
 
                                /* punt lines with just # (yacc generated) */
514
 
                                for (cp = bol+1; 
515
 
                                     *cp && (*cp == ' ' || *cp == '\t'); cp++);
516
 
                                if (*cp) goto done;
517
 
                        }
518
 
                        bol = p+1;
519
 
                }
520
 
        }
521
 
        if (*bol != '#')
522
 
                bol = NULL;
523
 
done:
524
 
        filep->f_p = p;
525
 
        filep->f_line = lineno;
526
 
        return(bol);
527
 
}
528
 
 
529
 
/*
530
 
 * Strip the file name down to what we want to see in the Makefile.
531
 
 * It will have objprefix and objsuffix around it.
532
 
 */
533
 
char *base_name(file)
534
 
        register char   *file;
535
 
{
536
 
        register char   *p;
537
 
 
538
 
        file = copy(file);
539
 
        for(p=file+strlen(file); p>file && *p != '.'; p--) ;
540
 
 
541
 
        if (*p == '.')
542
 
                *p = '\0';
543
 
        return(file);
544
 
}
545
 
 
546
 
#if defined(USG) && !defined(CRAY) && !defined(SVR4)
547
 
int rename (from, to)
548
 
    char *from, *to;
549
 
{
550
 
    (void) unlink (to);
551
 
    if (link (from, to) == 0) {
552
 
        unlink (from);
553
 
        return 0;
554
 
    } else {
555
 
        return -1;
556
 
    }
557
 
}
558
 
#endif /* USGISH */
559
 
 
560
 
redirect(line, makefile)
561
 
        char    *line,
562
 
                *makefile;
563
 
{
564
 
        struct stat     st;
565
 
        FILE    *fdin, *fdout;
566
 
        char    backup[ BUFSIZ ],
567
 
                buf[ BUFSIZ ];
568
 
        boolean found = FALSE;
569
 
        int     len;
570
 
 
571
 
        /*
572
 
         * if makefile is "-" then let it pour onto stdout.
573
 
         */
574
 
        if (makefile && *makefile == '-' && *(makefile+1) == '\0')
575
 
                return;
576
 
 
577
 
        /*
578
 
         * use a default makefile is not specified.
579
 
         */
580
 
        if (!makefile) {
581
 
                if (stat("Makefile", &st) == 0)
582
 
                        makefile = "Makefile";
583
 
                else if (stat("makefile", &st) == 0)
584
 
                        makefile = "makefile";
585
 
                else
586
 
                        fatalerr("[mM]akefile is not present\n");
587
 
        }
588
 
        else
589
 
            stat(makefile, &st);
590
 
        if ((fdin = fopen(makefile, "r")) == NULL)
591
 
                fatalerr("cannot open \"%s\"\n", makefile);
592
 
        sprintf(backup, "%s.bak", makefile);
593
 
        unlink(backup);
594
 
#ifdef WIN32
595
 
        fclose(fdin);
596
 
#endif
597
 
        if (rename(makefile, backup) < 0)
598
 
                fatalerr("cannot rename %s to %s\n", makefile, backup);
599
 
#ifdef WIN32
600
 
        if ((fdin = fopen(backup, "r")) == NULL)
601
 
                fatalerr("cannot open \"%s\"\n", backup);
602
 
#endif
603
 
        if ((fdout = freopen(makefile, "w", stdout)) == NULL)
604
 
                fatalerr("cannot open \"%s\"\n", backup);
605
 
        len = strlen(line);
606
 
        while (!found && fgets(buf, BUFSIZ, fdin)) {
607
 
                if (*buf == '#' && strncmp(line, buf, len) == 0)
608
 
                        found = TRUE;
609
 
                fputs(buf, fdout);
610
 
        }
611
 
        if (!found) {
612
 
                if (verbose)
613
 
                warning("Adding new delimiting line \"%s\" and dependencies...\n",
614
 
                        line);
615
 
                puts(line); /* same as fputs(fdout); but with newline */
616
 
        } else if (append) {
617
 
            while (fgets(buf, BUFSIZ, fdin)) {
618
 
                fputs(buf, fdout);
619
 
            }
620
 
        }
621
 
        fflush(fdout);
622
 
#if defined(USGISH) || defined(_SEQUENT_)
623
 
        chmod(makefile, st.st_mode);
624
 
#else
625
 
        fchmod(fileno(fdout), st.st_mode);
626
 
#endif /* USGISH */
627
 
}
628
 
 
629
 
#if NeedVarargsPrototypes
630
 
fatalerr(char *msg, ...)
631
 
#else
632
 
/*VARARGS*/
633
 
fatalerr(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
634
 
    char *msg;
635
 
#endif
636
 
{
637
 
#if NeedVarargsPrototypes
638
 
        va_list args;
639
 
#endif
640
 
        fprintf(stderr, "%s: error:  ", ProgramName);
641
 
#if NeedVarargsPrototypes
642
 
        va_start(args, msg);
643
 
        vfprintf(stderr, msg, args);
644
 
        va_end(args);
645
 
#else
646
 
        fprintf(stderr, msg,x1,x2,x3,x4,x5,x6,x7,x8,x9);
647
 
#endif
648
 
        exit (1);
649
 
}
650
 
 
651
 
#if NeedVarargsPrototypes
652
 
warning(char *msg, ...)
653
 
#else
654
 
/*VARARGS0*/
655
 
warning(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
656
 
    char *msg;
657
 
#endif
658
 
{
659
 
#if NeedVarargsPrototypes
660
 
        va_list args;
661
 
#endif
662
 
        fprintf(stderr, "%s: warning:  ", ProgramName);
663
 
#if NeedVarargsPrototypes
664
 
        va_start(args, msg);
665
 
        vfprintf(stderr, msg, args);
666
 
        va_end(args);
667
 
#else
668
 
        fprintf(stderr, msg,x1,x2,x3,x4,x5,x6,x7,x8,x9);
669
 
#endif
670
 
}
671
 
 
672
 
#if NeedVarargsPrototypes
673
 
warning1(char *msg, ...)
674
 
#else
675
 
/*VARARGS0*/
676
 
warning1(msg,x1,x2,x3,x4,x5,x6,x7,x8,x9)
677
 
    char *msg;
678
 
#endif
679
 
{
680
 
#if NeedVarargsPrototypes
681
 
        va_list args;
682
 
        va_start(args, msg);
683
 
        vfprintf(stderr, msg, args);
684
 
        va_end(args);
685
 
#else
686
 
        fprintf(stderr, msg,x1,x2,x3,x4,x5,x6,x7,x8,x9);
687
 
#endif
688
 
}