Changeset 1222 for trunk/src/kash/generated/init.c
- Timestamp:
- Oct 8, 2007, 2:24:31 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/generated/init.c
r1212 r1222 18 18 #include "trap.h" 19 19 #include "var.h" 20 21 22 23 #undef ATABSIZE 24 #define ATABSIZE 39 20 #include "shinstance.h" 21 22 23 24 #undef PROFILE 25 #define PROFILE 0 26 #undef SIGSSIZE 27 #define SIGSSIZE (sizeof(sigs)/sizeof(sigs[0])) 25 28 #undef MAXPWD 26 29 #define MAXPWD 256 … … 33 36 #undef EV_BACKCMD 34 37 #define EV_BACKCMD 04 /* command executing within back quotes */ 35 #undef CMDTABLESIZE36 #define CMDTABLESIZE 31 /* should be prime */37 #undef ARB38 #define ARB 1 /* actual size determined at run time */39 38 #undef NEWARGS 40 39 #define NEWARGS 5 … … 47 46 #undef EOF_NLEFT 48 47 #define EOF_NLEFT -99 /* value of parsenleft when EOF pushed back */ 49 #undef MAXMBOXES50 #define MAXMBOXES 1051 #undef PROFILE52 #define PROFILE 053 #undef SIGSSIZE54 #define SIGSSIZE (sizeof(sigs)/sizeof(sigs[0]))55 #undef MINSIZE56 #define MINSIZE 504 /* minimum size of a block */57 48 #undef DEFINE_OPTIONS 58 49 #define DEFINE_OPTIONS 59 #undef OUTBUFSIZ60 #define OUTBUFSIZ BUFSIZ61 50 #undef BLOCK_OUT 62 51 #define BLOCK_OUT -2 /* output to a fixed block of memory */ 63 #undef MEM_OUT64 #define MEM_OUT -3 /* output to dynamically allocated memory */65 52 #undef OUTPUT_ERR 66 53 #define OUTPUT_ERR 01 /* error occurred on output */ 67 54 #undef TEMPSIZE 68 #define TEMPSIZE 2455 #define TEMPSIZE 32 69 56 #undef HAVE_VASPRINTF 70 57 #define HAVE_VASPRINTF 1 … … 107 94 #undef QHINF_MAPSEL 108 95 #define QHINF_MAPSEL 8 /* NE only */ 109 #undef VTABSIZE 110 #define VTABSIZE 39 111 #undef VTABSIZE 112 #define VTABSIZE 517 113 #undef main 114 #define main echocmd 115 #undef main 116 #define main killcmd 117 118 119 120 extern void rmaliases(struct shinstance *); 121 122 extern int loopnest; /* current loop nesting level */ 96 #undef SET_LEN 97 #define SET_LEN 6 /* initial # of bitcmd struct to malloc */ 98 #undef SET_LEN_INCR 99 #define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */ 100 #undef CMD2_CLR 101 #define CMD2_CLR 0x01 102 #undef CMD2_SET 103 #define CMD2_SET 0x02 104 #undef CMD2_GBITS 105 #define CMD2_GBITS 0x04 106 #undef CMD2_OBITS 107 #define CMD2_OBITS 0x08 108 #undef CMD2_UBITS 109 #define CMD2_UBITS 0x10 110 #undef STANDARD_BITS 111 #define STANDARD_BITS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) 112 113 114 115 extern void rmaliases(shinstance *psh); 123 116 124 117 extern void deletefuncs(struct shinstance *); 125 118 extern void hash_special_builtins(struct shinstance *); 126 127 struct strpush {128 struct strpush *prev; /* preceding string on stack */129 char *prevstring;130 int prevnleft;131 int prevlleft;132 struct alias *ap; /* if push was associated with an alias */133 };134 135 struct parsefile {136 struct parsefile *prev; /* preceding file on stack */137 int linno; /* current line */138 int fd; /* file descriptor (or -1 if string) */139 int nleft; /* number of chars left in this line */140 int lleft; /* number of chars left in this buffer */141 char *nextc; /* next char in buffer */142 char *buf; /* input buffer */143 struct strpush *strpush; /* for pushing strings at this level */144 struct strpush basestrpush; /* so pushing one is fast */145 };146 147 extern int parselleft; /* copy of parsefile->lleft */148 extern struct parsefile basepf; /* top level input file */149 extern char basebuf[BUFSIZ]; /* buffer for top level input file */150 151 extern pid_t backgndpid; /* pid of last background process */152 extern int jobctl;153 154 extern int tokpushback; /* last token pushed back */155 extern int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */156 119 157 120 struct redirtab { … … 160 123 }; 161 124 162 //extern struct redirtab *redirlist;163 164 extern char sigmode[NSIG]; /* current value of signal */165 166 extern char **environ;167 168 125 169 126 … … 177 134 /* from exec.c: */ 178 135 { 179 hash_special_builtins( );136 hash_special_builtins(psh); 180 137 } 181 138 182 139 /* from input.c: */ 183 140 { 184 basepf.nextc = basepf.buf =basebuf;141 psh->basepf.nextc = psh->basepf.buf = psh->basebuf; 185 142 } 186 143 … … 190 147 191 148 initvar(psh); 192 for (envp = environ; *envp ; envp++) {149 for (envp = sh_environ(psh) ; *envp ; envp++) { 193 150 if (strchr(*envp, '=')) { 194 151 setvareq(psh, *envp, VEXPORT|VTEXTFIXED); … … 226 183 psh->out1 = &psh->output; 227 184 psh->out2 = &psh->errout; 228 if ( memout.buf != NULL) {229 ckfree( memout.buf);230 memout.buf = NULL;185 if (psh->memout.buf != NULL) { 186 ckfree(psh->memout.buf); 187 psh->memout.buf = NULL; 231 188 } 232 189 } … … 278 235 psh->backgndpid = -1; 279 236 #if JOBS 280 jobctl = 0;237 psh->jobctl = 0; 281 238 #endif 282 239 } … … 286 243 int i; 287 244 288 for (i = 0; optlist[i].name; i++)289 optlist[i].val = 0;245 for (i = 0; psh->optlist[i].name; i++) 246 psh->optlist[i].val = 0; 290 247 optschanged(psh); 291 248
Note:
See TracChangeset
for help on using the changeset viewer.