#include <sys/types.h>#include <sys/wait.h>#include <errno.h>#include <signal.h>#include <string.h>#include <stdlib.h>#include <fcntl.h>#include <unistd.h>Include dependency graph for cc.c:

Go to the source code of this file.
Data Structures | |
| struct | passinfo |
| struct | compile |
| struct | compile::pass |
| struct | arglist |
Defines | |
| #define | SHELL "/bin/sh" |
| #define | PP "/usr/lib/ncpp" |
| #define | IRREL "/usr/lib/irrel" |
| #define | CEM "/usr/lib/ncem" |
| #define | M2EM "/usr/lib/nm2em" |
| #define | ENCODE "/usr/lib/em_encode" |
| #define | OPT "/usr/lib/nopt" |
| #define | CG "/usr/lib/ncg" |
| #define | AS "/usr/lib/as" |
| #define | LD "/usr/lib/ld" |
| #define | CV "/usr/lib/cv" |
| #define | LIBDIR "/usr/lib" |
| #define | CRT "/usr/lib/ncrtso.o" |
| #define | PEM "/usr/lib/npem" |
| #define | PRT "/usr/lib/nprtso.o" |
| #define | M2RT "/usr/lib/nm2rtso.o" |
| #define | LIBC "/usr/lib/libd.a", "/usr/lib/libc.a" |
| #define | LIBP "/usr/lib/libp.a", "/usr/lib/libc.a" |
| #define | LIBM2 "/usr/lib/libm2.a", "/usr/lib/libc.a" |
| #define | END "/usr/lib/libe.a", "/usr/lib/end.a" |
| #define | M2DEF "-I/usr/lib/m2" |
| #define | INPUT 01 |
| #define | OUTPUT 02 |
| #define | LOADER 04 |
| #define | STDIN 010 |
| #define | STDOUT 020 |
| #define | NOCLEAN 040 |
| #define | O_OUTPUT 0100 |
| #define | PREPALWAYS 0200 |
| #define | PREPCOND 0400 |
| #define | PREPNOLN 01000 |
| #define | MAXHEAD 10 |
| #define | MAXTAIL 5 |
| #define | MAXPASS 7 |
| #define | DEFLANG 010 |
| #define | PREP_FLAGS |
| #define | MAXARGC 150 |
| #define | USTR_SIZE 64 |
| #define | init(a) ((a)->al_argc = 1) |
| #define | cleanup(str) (str && remove(str)) |
Typedefs | |
| typedef char | USTRING [USTR_SIZE] |
Functions | |
| _PROTOTYPE (char *library,(char *nm)) | |
| _PROTOTYPE (void trapcc,(int sig)) | |
| _PROTOTYPE (int main,(int argc, char *argv[])) | |
| _PROTOTYPE (int remove,(char *str)) | |
| _PROTOTYPE (char *alloc,(unsigned u)) | |
| _PROTOTYPE (int append,(struct arglist *al, char *arg)) | |
| _PROTOTYPE (int concat,(struct arglist *al1, struct arglist *al2)) | |
| _PROTOTYPE (char *mkstr,(char *dst, char *arg1, char *arg2, char *arg3)) | |
| _PROTOTYPE (int basename,(char *str, char *dst)) | |
| _PROTOTYPE (char *extension,(char *fln)) | |
| _PROTOTYPE (int runvec,(struct arglist *vec, struct passinfo *pass, char *in, char *out)) | |
| _PROTOTYPE (int prnum,(unsigned x)) | |
| _PROTOTYPE (int pr_vec,(struct arglist *vec)) | |
| _PROTOTYPE (int mktempname,(char *nm)) | |
| _PROTOTYPE (int mkbase,(void)) | |
| _PROTOTYPE (int needsprep,(char *name)) | |
| _PROTOTYPE (char *apply,(struct passinfo *pinf, struct compile *cp, char *name, int passindex, int noremove, int first, char *resultname)) | |
| _PROTOTYPE (int applicable,(struct passinfo *pinf, char *suffix)) | |
| _PROTOTYPE (char *process,(char *name, int noremove)) | |
| _PROTOTYPE (int mkvec,(struct arglist *call, char *in, char *out, struct pass *pass, struct passinfo *pinf)) | |
| _PROTOTYPE (int callld,(struct arglist *in, char *out, struct pass *pass, struct passinfo *pinf)) | |
| _PROTOTYPE (int clean,(struct arglist *c)) | |
| _PROTOTYPE (int scanflags,(struct arglist *call, struct passinfo *pinf)) | |
| char * | library (char *nm) |
| void | trapcc (int sig) |
| main (argc, argv) | |
| remove (char *str) | |
| char * | alloc (unsigned u) |
| append (struct arglist *al, char *arg) | |
| concat (struct arglist *al1, struct arglist *al2) | |
| char * | mkstr (char *dst, char *arg1, char *arg2, char *arg3) |
| basename (char *str, char *dst) | |
| char * | extension (char *fln) |
| runvec (struct arglist *vec, struct passinfo *pass, char *in, char *out) | |
| prnum (unsigned x) | |
| prs (char *str) | |
| panic (char *str) | |
| pr_vec (struct arglist *vec) | |
| ex_vec (struct arglist *vec) | |
| mktempname (char *nm) | |
| mkbase () | |
| mkloader () | |
| needsprep (char *name) | |
| cfile (char *name) | |
| char * | apply (struct passinfo *pinf, struct compile *cp, char *name, passindex, noremove, first, char *resultname) |
| int | applicable (struct passinfo *pinf, char *suffix) |
| char * | process (char *name, noremove) |
| mkvec (struct arglist *call, char *in, char *out, struct pass *pass, struct passinfo *pinf) | |
| callld (struct arglist *in, char *out, struct pass *pass, struct passinfo *pinf) | |
| clean (struct arglist *c) | |
| scanflags (struct arglist *call, struct passinfo *pinf) | |
Variables | |
| passinfo | passinfo [] |
| pass | preprocessor |
| pass | prepnoln |
| pass | irrel |
| compile | passes [] |
| arglist | CALLVEC |
| int | kids = -1 |
| char * | o_FILE = "a.out" |
| char * | ProgCall = 0 |
| int | RET_CODE = 0 |
| char * | stopsuffix |
| int | v_flag = 0 |
| int | t_flag = 0 |
| int | noexec = 0 |
| int | fp_lib = 1 |
| int | E_flag = 0 |
| int | i_flag = 1 |
| USTRING | curfil |
| USTRING | newfil |
| arglist | SRCFILES |
| arglist | LDIRS |
| arglist | LDFILES |
| arglist | GEN_LDFILES |
| arglist | FLAGS |
| char * | tmpdir = "/tmp" |
| char | tmpname [64] |
| compile * | compbase |
| pass * | loader |
| passinfo * | loaderinfo |
| char * | source |
| int | maxLlen |
|
|
Definition at line 27 of file cc.c. Referenced by starttcap(). |
|
|
|
|
|
|
|
|
Definition at line 212 of file cc.c. Referenced by apply(), do_waitpid(), dowait(), e(), pm_exit(), quit(), and trapcc(). |
|
|
|
|
|
Definition at line 29 of file cc.c. Referenced by starttcap(). |
|
|
Definition at line 97 of file cc.c. Referenced by process(). |
|
|
|
|
|
|
|
|
Definition at line 211 of file cc.c. Referenced by callld(), cmd_edit(), gzifstream::gzifstream(), gzofstream::gzofstream(), main(), mkvec(), and TTYinfo(). |
|
|
Definition at line 60 of file cc.c. Referenced by callld(), evaluate(), get_list(), mkvec(), prin1(), and unix_exec(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 30 of file cc.c. Referenced by main(). |
|
|
|
|
|
|
|
|
Definition at line 62 of file cc.c. Referenced by main(), mkloader(), and process(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 65 of file cc.c. Referenced by apply(). |
|
|
Definition at line 66 of file cc.c. Referenced by mkvec(). |
|
|
|
|
|
Definition at line 61 of file cc.c. Referenced by callld(), evaluate(), get_list(), mkvec(), prin1(), and unix_exec(). |
|
|
|
|
|
|
|
|
Value: "-D_EM_WSIZE=2", "-D_EM_PSIZE=2", "-D_EM_SSIZE=2", \ "-D_EM_LSIZE=4", "-D_EM_FSIZE=4", "-D_EM_DSIZE=8", \ "-D__ACK__", "-D__minix", "-D__i86" |
|
|
Definition at line 67 of file cc.c. Referenced by apply(). |
|
|
Definition at line 68 of file cc.c. Referenced by apply(). |
|
|
Definition at line 69 of file cc.c. Referenced by apply(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
Definition at line 476 of file cc.c. References a, alloc(), MAXARGC, panic, strcpy(), and strlen(). |
|
||||||||||||
|
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 769 of file cc.c. References CALLVEC, cfile, cleanup, curfil, first, irrel, mkstr(), mkvec(), newfil, NOCLEAN, o_FILE, passinfo, PREPALWAYS, PREPCOND, prepnoln, PREPNOLN, preprocessor, runvec(), strcpy(), and tmpname. Referenced by process(). |
|
||||||||||||
|
Definition at line 520 of file cc.c. References p1. |
|
||||||||||||||||||||
|
Definition at line 943 of file cc.c. References append(), CALLVEC, if(), init, INPUT, library(), MAXHEAD, OUTPUT, and scanflags(). Referenced by main(). |
|
|
|
|
|
Definition at line 983 of file cc.c. References free. |
|
||||||||||||
|
Definition at line 488 of file cc.c. References MAXARGC, p, and panic. Referenced by evalcmd(). |
|
|
Definition at line 672 of file cc.c. References access, ENOEXEC, errno, execv, exit(), prs(), and SHELL. Referenced by runvec(). |
|
|
Definition at line 542 of file cc.c. References fn. Referenced by process(). |
|
|
Definition at line 276 of file cc.c. References access, arglist::al_argc, arglist::al_argv, f, LDIRS, mkstr(), strcat(), and strlen(). |
|
||||||||||||
|
Definition at line 311 of file cc.c. References arglist::al_argc, arglist::al_argv, append(), argc, callld(), clean(), count, E_flag, exit(), FLAGS, fp_lib, free, GEN_LDFILES, i_flag, LDFILES, LDIRS, LIBDIR, library(), LOADER, loader, maxLlen, mkbase(), mkstr(), mktempname(), newfil, noexec, o_FILE, passinfo::p_flags, passinfo::p_name, passinfo::p_to, passinfo, process(), ProgCall, remove(), RET_CODE, SIG_IGN, SIGHUP, SIGINT, signal(), SIGQUIT, source, SRCFILES, stopsuffix, strcmp, strlen(), t_flag, tmpdir, tmpname, and v_flag. |
|
|
Definition at line 713 of file cc.c. References basename, compbase, mkloader(), p, panic, passes, ProgCall, strcmp, and strlen(). Referenced by main(). |
|
|
Definition at line 733 of file cc.c. References compile::c_passes, compbase, loader, LOADER, loaderinfo, p, passinfo, and strcmp. Referenced by mkbase(). |
|
||||||||||||||||||||
|
Definition at line 502 of file cc.c. References p. Referenced by apply(), library(), main(), and mktempname(). |
|
|
Definition at line 696 of file cc.c. References compile::c_callname, compbase, getpid, mkstr(), pid, and tmpdir. Referenced by main(). |
|
||||||||||||||||||||||||
|
Definition at line 914 of file cc.c. References append(), i, if(), init, INPUT, MAXHEAD, O_OUTPUT, OUTPUT, scanflags(), and strcmp. Referenced by apply(). |
|
|
|
|
|
|
|
|
Definition at line 656 of file cc.c. References prs(), and strlen(). Referenced by runvec(). |
|
|
|
|
||||||||||||
|
Definition at line 859 of file cc.c. References append(), apply(), base, basename, compbase, cp, DEFLANG, E_flag, extension(), first, GEN_LDFILES, LOADER, loaderinfo, passinfo::p_flags, passinfo::p_name, passinfo::p_to, passes, passinfo, stopsuffix, strcat(), strcmp, suffix, and tmpname. |
|
|
Definition at line 642 of file cc.c. References strlen(), and write. Referenced by badid(), collect(), dochdir(), dologin(), dotimes(), dotrap(), echo(), ex_vec(), execute(), forkexec(), getn(), iosetup(), newfile(), onintr(), panic(), pr_vec(), prn(), prnum(), readhere(), remove(), runvec(), tree(), waitfor(), warn(), and yylex(). |
|
|
Definition at line 451 of file cc.c. References noexec, prs(), t_flag, unlink, and v_flag. Referenced by cleanUpAndFail(), getdiv(), killdiv(), main(), mpartition(), tar(), tmpfile(), uncompress(), and unzRepair(). |
|
||||||||||||||||||||
|
Definition at line 553 of file cc.c. References clean(), close, creat, E_flag, ex_vec(), fork, kids, noexec, open, passinfo::p_flags, panic, pid, pr_vec(), prnum(), prs(), RET_CODE, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, status, STDIN, STDOUT, strcmp, strncmp(), v_flag, and wait. Referenced by apply(). |
|
||||||||||||
|
Definition at line 995 of file cc.c. References arglist::al_argc, arglist::al_argv, FLAGS, p, and passinfo::p_acceptflags. |
|
|
Definition at line 301 of file cc.c. References cleanup, curfil, exit(), kids, kill, newfil, SIG_IGN, and signal(). Referenced by panic(). |
|
|
|
|
|
Definition at line 238 of file cc.c. Referenced by mkbase(), mkloader(), mktempname(), and process(). |
|
|
|
|
|
|
|
|
Definition at line 233 of file cc.c. Referenced by main(), and scanflags(). |
|
|
Definition at line 222 of file cc.c. Referenced by main(). |
|
|
|
|
|
Definition at line 224 of file cc.c. Referenced by main(). |
|
|
Initial value: { "irrel",
{0}
}
Definition at line 129 of file cc.c. Referenced by apply(). |
|
|
|
|
|
Definition at line 231 of file cc.c. Referenced by main(). |
|
|
|
|
|
Definition at line 239 of file cc.c. Referenced by main(), and mkloader(). |
|
|
Definition at line 240 of file cc.c. Referenced by mkloader(), and process(). |
|
|
Definition at line 242 of file cc.c. Referenced by main(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 136 of file cc.c. Referenced by main(), mkbase(), process(), test16a(), and test19f(). |
|
|
Initial value: {
{ "cpp", PP, "CPP", "i", "wo=o,I*,D*,U*,P", INPUT|STDOUT },
{ "irrel", IRREL, "i", "i", "m", INPUT},
{ "cem", CEM, "i,c", "k", "m=o,p,wa=a,wo=o,ws=s,w,T*", INPUT|OUTPUT|PREPALWAYS },
{ "pc", PEM, "i,p", "k", "n=L,w,a,A,R", INPUT|OUTPUT|PREPCOND },
{ "m2", M2EM, "i,mod", "k", "n=L,w*,A,R,W*,3,I*", INPUT|OUTPUT|PREPCOND },
{ "encode", ENCODE, "i,e", "k", "", INPUT|STDOUT|PREPCOND|PREPNOLN },
{ "opt", OPT, "k", "m", "", STDIN|STDOUT },
{ "cg", CG, "m", "s", "O=p4", INPUT|OUTPUT },
{ "as", AS, "i,s", "o", "T*", INPUT|O_OUTPUT|PREPCOND },
{ "ld", LD, "o", "out", "i,s", INPUT|LOADER },
{ "cv", CV, "out", 0, "", INPUT|OUTPUT|NOCLEAN },
{ 0}
}
Definition at line 100 of file cc.c. Referenced by apply(), main(), mkloader(), and process(). |
|
|
Initial value: { "cpp",
{ PREP_FLAGS, "-P" }
, {0}
}
Definition at line 124 of file cc.c. Referenced by apply(). |
|
|
Initial value: { "cpp",
{ PREP_FLAGS }
, {0}
}
Definition at line 119 of file cc.c. Referenced by apply(). |
|
|
|
|
|
|
|
|
Definition at line 241 of file cc.c. Referenced by def(), getfile(), inf(), main(), rsource(), and unzOpenCurrentFile3(). |
|
|
Definition at line 229 of file cc.c. Referenced by main(). |
|
|
|
|
|
|
|
|
Definition at line 235 of file cc.c. Referenced by create_file_names(), main(), and mktempname(). |
|
|
|
|
|
|
1.4.6