diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-10-13 08:27:37 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-10-13 08:27:37 -0700 |
commit | d1a19f0d477a6249d8af9322317b8434b86260ea (patch) | |
tree | 59e49fc95018bb9d09e4a76a012f6f06ae345c67 /sys/cmd/rc/main.c | |
parent | 7d7af85919bbd352bb7dc0b5751b3684f8f0a8e4 (diff) |
fix(email): bytes error. updated vendoring
Diffstat (limited to 'sys/cmd/rc/main.c')
-rw-r--r-- | sys/cmd/rc/main.c | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/sys/cmd/rc/main.c b/sys/cmd/rc/main.c deleted file mode 100644 index b4a355e..0000000 --- a/sys/cmd/rc/main.c +++ /dev/null @@ -1,86 +0,0 @@ -#include "rc.h" - -/* globals */ -Thread *shell = nil; -int ntrap = 0; -Io *errio; - -/* main execution */ - -void -dotrap(void) -{ - exit(1); -} - -void -bootup(Code *c, int off, Var *vars) -{ - Thread *sh; - - alloc(sh); - sh->code = c, c->i++; - sh->ip = sh->code + off; - sh->local = vars; - sh->stack = nil; - - sh->link = shell, shell = sh; -} - -int -main(int argc, char *argv[]) -{ - int i; - Code *ip, sh[32]; - - ARGBEGIN { - } ARGEND; - - errio = openfd(2); - - initkw(); - - ip = sh; - memset(sh, 0, sizeof(sh)); - /* - * NOTE: first element of code is a reference count - * bootup runs: - * 1. *=argv[1:] - * 2. . rcmain $* - */ -#if 0 - ip++->i = 1; - ip++->f = Xmark; - ip++->f = Xword; - ip++->s = "*"; - ip++->f = Xassign; - ip++->f = Xmark; - ip++->f = Xmark; - ip++->s = "*"; - ip++->f = Xdol; - ip++->s = "rcmain"; - ip++->f = Xword; - ip++->s = "."; - ip++->f = Xsimple; - ip++->f = Xexit; - ip++->i = 0; - - bootup(sh, 1, nil); - pushlist(); - for (i = argc-1; i != 0; i--) - pushword(argv[i]); - - for (;;) { - shell->ip++->f(); - if (ntrap) - dotrap(); - } -#else - bootup(sh, 1, nil); - shell->cmd.io = openfd(0); - while (parse()) - ; - -#endif - exit(0); -} |