cmd 28 user/sh.c struct cmd *cmd; cmd 37 user/sh.c struct cmd *left; cmd 38 user/sh.c struct cmd *right; cmd 43 user/sh.c struct cmd *left; cmd 44 user/sh.c struct cmd *right; cmd 49 user/sh.c struct cmd *cmd; cmd 54 user/sh.c struct cmd *parsecmd(char*); cmd 55 user/sh.c void runcmd(struct cmd*) __attribute__((noreturn)); cmd 59 user/sh.c runcmd(struct cmd *cmd) cmd 68 user/sh.c if(cmd == 0) cmd 71 user/sh.c switch(cmd->type){ cmd 76 user/sh.c ecmd = (struct execcmd*)cmd; cmd 84 user/sh.c rcmd = (struct redircmd*)cmd; cmd 90 user/sh.c runcmd(rcmd->cmd); cmd 94 user/sh.c lcmd = (struct listcmd*)cmd; cmd 102 user/sh.c pcmd = (struct pipecmd*)cmd; cmd 126 user/sh.c bcmd = (struct backcmd*)cmd; cmd 128 user/sh.c runcmd(bcmd->cmd); cmd 196 user/sh.c struct cmd* cmd 199 user/sh.c struct execcmd *cmd; cmd 201 user/sh.c cmd = malloc(sizeof(*cmd)); cmd 202 user/sh.c memset(cmd, 0, sizeof(*cmd)); cmd 203 user/sh.c cmd->type = EXEC; cmd 204 user/sh.c return (struct cmd*)cmd; cmd 207 user/sh.c struct cmd* cmd 208 user/sh.c redircmd(struct cmd *subcmd, char *file, char *efile, int mode, int fd) cmd 210 user/sh.c struct redircmd *cmd; cmd 212 user/sh.c cmd = malloc(sizeof(*cmd)); cmd 213 user/sh.c memset(cmd, 0, sizeof(*cmd)); cmd 214 user/sh.c cmd->type = REDIR; cmd 215 user/sh.c cmd->cmd = subcmd; cmd 216 user/sh.c cmd->file = file; cmd 217 user/sh.c cmd->efile = efile; cmd 218 user/sh.c cmd->mode = mode; cmd 219 user/sh.c cmd->fd = fd; cmd 220 user/sh.c return (struct cmd*)cmd; cmd 223 user/sh.c struct cmd* cmd 224 user/sh.c pipecmd(struct cmd *left, struct cmd *right) cmd 226 user/sh.c struct pipecmd *cmd; cmd 228 user/sh.c cmd = malloc(sizeof(*cmd)); cmd 229 user/sh.c memset(cmd, 0, sizeof(*cmd)); cmd 230 user/sh.c cmd->type = PIPE; cmd 231 user/sh.c cmd->left = left; cmd 232 user/sh.c cmd->right = right; cmd 233 user/sh.c return (struct cmd*)cmd; cmd 236 user/sh.c struct cmd* cmd 237 user/sh.c listcmd(struct cmd *left, struct cmd *right) cmd 239 user/sh.c struct listcmd *cmd; cmd 241 user/sh.c cmd = malloc(sizeof(*cmd)); cmd 242 user/sh.c memset(cmd, 0, sizeof(*cmd)); cmd 243 user/sh.c cmd->type = LIST; cmd 244 user/sh.c cmd->left = left; cmd 245 user/sh.c cmd->right = right; cmd 246 user/sh.c return (struct cmd*)cmd; cmd 249 user/sh.c struct cmd* cmd 250 user/sh.c backcmd(struct cmd *subcmd) cmd 252 user/sh.c struct backcmd *cmd; cmd 254 user/sh.c cmd = malloc(sizeof(*cmd)); cmd 255 user/sh.c memset(cmd, 0, sizeof(*cmd)); cmd 256 user/sh.c cmd->type = BACK; cmd 257 user/sh.c cmd->cmd = subcmd; cmd 258 user/sh.c return (struct cmd*)cmd; cmd 323 user/sh.c struct cmd *parseline(char**, char*); cmd 324 user/sh.c struct cmd *parsepipe(char**, char*); cmd 325 user/sh.c struct cmd *parseexec(char**, char*); cmd 326 user/sh.c struct cmd *nulterminate(struct cmd*); cmd 328 user/sh.c struct cmd* cmd 332 user/sh.c struct cmd *cmd; cmd 335 user/sh.c cmd = parseline(&s, es); cmd 341 user/sh.c nulterminate(cmd); cmd 342 user/sh.c return cmd; cmd 345 user/sh.c struct cmd* cmd 348 user/sh.c struct cmd *cmd; cmd 350 user/sh.c cmd = parsepipe(ps, es); cmd 353 user/sh.c cmd = backcmd(cmd); cmd 357 user/sh.c cmd = listcmd(cmd, parseline(ps, es)); cmd 359 user/sh.c return cmd; cmd 362 user/sh.c struct cmd* cmd 365 user/sh.c struct cmd *cmd; cmd 367 user/sh.c cmd = parseexec(ps, es); cmd 370 user/sh.c cmd = pipecmd(cmd, parsepipe(ps, es)); cmd 372 user/sh.c return cmd; cmd 375 user/sh.c struct cmd* cmd 376 user/sh.c parseredirs(struct cmd *cmd, char **ps, char *es) cmd 387 user/sh.c cmd = redircmd(cmd, q, eq, O_RDONLY, 0); cmd 390 user/sh.c cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE|O_TRUNC, 1); cmd 393 user/sh.c cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1); cmd 397 user/sh.c return cmd; cmd 400 user/sh.c struct cmd* cmd 403 user/sh.c struct cmd *cmd; cmd 408 user/sh.c cmd = parseline(ps, es); cmd 412 user/sh.c cmd = parseredirs(cmd, ps, es); cmd 413 user/sh.c return cmd; cmd 416 user/sh.c struct cmd* cmd 421 user/sh.c struct execcmd *cmd; cmd 422 user/sh.c struct cmd *ret; cmd 428 user/sh.c cmd = (struct execcmd*)ret; cmd 437 user/sh.c cmd->argv[argc] = q; cmd 438 user/sh.c cmd->eargv[argc] = eq; cmd 444 user/sh.c cmd->argv[argc] = 0; cmd 445 user/sh.c cmd->eargv[argc] = 0; cmd 450 user/sh.c struct cmd* cmd 451 user/sh.c nulterminate(struct cmd *cmd) cmd 460 user/sh.c if(cmd == 0) cmd 463 user/sh.c switch(cmd->type){ cmd 465 user/sh.c ecmd = (struct execcmd*)cmd; cmd 471 user/sh.c rcmd = (struct redircmd*)cmd; cmd 472 user/sh.c nulterminate(rcmd->cmd); cmd 477 user/sh.c pcmd = (struct pipecmd*)cmd; cmd 483 user/sh.c lcmd = (struct listcmd*)cmd; cmd 489 user/sh.c bcmd = (struct backcmd*)cmd; cmd 490 user/sh.c nulterminate(bcmd->cmd); cmd 493 user/sh.c return cmd;