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