1 /* 2 * This file was generated by the mknodes program. 3 */ 4 5 #define NSEMI 0 6 #define NCMD 1 7 #define NPIPE 2 8 #define NREDIR 3 9 #define NBACKGND 4 10 #define NSUBSHELL 5 11 #define NAND 6 12 #define NOR 7 13 #define NIF 8 14 #define NWHILE 9 15 #define NUNTIL 10 16 #define NFOR 11 17 #define NCASE 12 18 #define NCLIST 13 19 #define NCLISTFALLTHRU 14 20 #define NDEFUN 15 21 #define NARG 16 22 #define NTO 17 23 #define NFROM 18 24 #define NFROMTO 19 25 #define NAPPEND 20 26 #define NCLOBBER 21 27 #define NTOFD 22 28 #define NFROMFD 23 29 #define NHERE 24 30 #define NXHERE 25 31 #define NNOT 26 32 33 34 35 struct nbinary { 36 int type; 37 union node *ch1; 38 union node *ch2; 39 }; 40 41 42 struct ncmd { 43 int type; 44 union node *args; 45 union node *redirect; 46 }; 47 48 49 struct npipe { 50 int type; 51 int backgnd; 52 struct nodelist *cmdlist; 53 }; 54 55 56 struct nredir { 57 int type; 58 union node *n; 59 union node *redirect; 60 }; 61 62 63 struct nif { 64 int type; 65 union node *test; 66 union node *ifpart; 67 union node *elsepart; 68 }; 69 70 71 struct nfor { 72 int type; 73 union node *args; 74 union node *body; 75 char *var; 76 }; 77 78 79 struct ncase { 80 int type; 81 union node *expr; 82 union node *cases; 83 }; 84 85 86 struct nclist { 87 int type; 88 union node *next; 89 union node *pattern; 90 union node *body; 91 }; 92 93 94 struct narg { 95 int type; 96 union node *next; 97 char *text; 98 struct nodelist *backquote; 99 }; 100 101 102 struct nfile { 103 int type; 104 int fd; 105 union node *next; 106 union node *fname; 107 char *expfname; 108 }; 109 110 111 struct ndup { 112 int type; 113 int fd; 114 union node *next; 115 int dupfd; 116 union node *vname; 117 }; 118 119 120 struct nhere { 121 int type; 122 int fd; 123 union node *next; 124 union node *doc; 125 const char *expdoc; 126 }; 127 128 129 struct nnot { 130 int type; 131 union node *com; 132 }; 133 134 135 union node { 136 int type; 137 struct nbinary nbinary; 138 struct ncmd ncmd; 139 struct npipe npipe; 140 struct nredir nredir; 141 struct nif nif; 142 struct nfor nfor; 143 struct ncase ncase; 144 struct nclist nclist; 145 struct narg narg; 146 struct nfile nfile; 147 struct ndup ndup; 148 struct nhere nhere; 149 struct nnot nnot; 150 }; 151 152 153 struct nodelist { 154 struct nodelist *next; 155 union node *n; 156 }; 157 158 159 struct funcdef; 160 struct funcdef *copyfunc(union node *); 161 union node *getfuncnode(struct funcdef *); 162 void reffunc(struct funcdef *); 163 void unreffunc(struct funcdef *); 164