BSD 4 release
[unix-history] / usr / src / cmd / csh / sh.init.c
index fbe00df..fbb2373 100644 (file)
@@ -1,55 +1,71 @@
-/* Copyright (c) 1979 Regents of the University of California */
+static char *sccsid = "@(#)sh.init.c 4.1 10/9/80";
+
 #include "sh.local.h"
 #include "sh.local.h"
+
 /*
  * C shell
  */
 
 /*
  * C shell
  */
 
-extern int await();
-extern int chngd();
 extern int doalias();
 extern int doalias();
+extern int dobg();
 extern int dobreak();
 extern int dobreak();
+extern int dochngd();
 extern int docontin();
 extern int docontin();
+extern int dodirs();
 extern int doecho();
 extern int doelse();
 extern int doend();
 extern int doendif();
 extern int doendsw();
 extern int doecho();
 extern int doelse();
 extern int doend();
 extern int doendif();
 extern int doendsw();
+extern int doeval();
 extern int doexit();
 extern int doexit();
+extern int dofg();
 extern int doforeach();
 extern int doglob();
 extern int dogoto();
 extern int dohash();
 extern int doforeach();
 extern int doglob();
 extern int dogoto();
 extern int dohash();
-extern int hashstat();
 extern int dohist();
 extern int doif();
 extern int dohist();
 extern int doif();
+extern int dojobs();
+extern int dokill();
 extern int dolet();
 extern int dolet();
+extern int dolimit();
 extern int dologin();
 extern int dologout();
 extern int donewgrp();
 extern int donice();
 extern int dologin();
 extern int dologout();
 extern int donewgrp();
 extern int donice();
+extern int donotify();
 extern int donohup();
 extern int doonintr();
 extern int donohup();
 extern int doonintr();
+extern int dopopd();
+extern int dopushd();
 extern int dorepeat();
 extern int doset();
 extern int dosetenv();
 extern int dosource();
 extern int dorepeat();
 extern int doset();
 extern int dosetenv();
 extern int dosource();
+extern int dostop();
+extern int dosuspend();
 extern int doswbrk();
 extern int doswitch();
 extern int dotime();
 extern int doswbrk();
 extern int doswitch();
 extern int dotime();
-#ifndef V6
+extern int dounlimit();
 extern int doumask();
 extern int doumask();
-#endif
+extern int dowait();
 extern int dowhile();
 extern int dozip();
 extern int execash();
 extern int goodbye();
 extern int dowhile();
 extern int dozip();
 extern int execash();
 extern int goodbye();
+#ifdef VFORK
+extern int hashstat();
+#endif
 extern int shift();
 extern int showall();
 extern int unalias();
 extern int dounhash();
 extern int unset();
 extern int shift();
 extern int showall();
 extern int unalias();
 extern int dounhash();
 extern int unset();
+extern int dounsetenv();
 
 
-#define INF    1000
+#define        INF     1000
 
 struct biltins {
        char    *bname;
 
 struct biltins {
        char    *bname;
@@ -61,49 +77,70 @@ struct      biltins {
 #ifdef debug
        "alloc",        showall,        0,      1,
 #endif
 #ifdef debug
        "alloc",        showall,        0,      1,
 #endif
+       "bg",           dobg,           0,      INF,
        "break",        dobreak,        0,      0,
        "breaksw",      doswbrk,        0,      0,
        "break",        dobreak,        0,      0,
        "breaksw",      doswbrk,        0,      0,
+#ifdef IIASA
+       "bye",          goodbye,        0,      0,
+#endif
        "case",         dozip,          0,      1,
        "case",         dozip,          0,      1,
-       "cd",           chngd,          0,      1,
-       "chdir",        chngd,          0,      1,
+       "cd",           dochngd,        0,      1,
+       "chdir",        dochngd,        0,      1,
        "continue",     docontin,       0,      0,
        "default",      dozip,          0,      0,
        "continue",     docontin,       0,      0,
        "default",      dozip,          0,      0,
+       "dirs",         dodirs,         0,      1,
        "echo",         doecho,         0,      INF,
        "else",         doelse,         0,      INF,
        "end",          doend,          0,      0,
        "endif",        dozip,          0,      0,
        "endsw",        dozip,          0,      0,
        "echo",         doecho,         0,      INF,
        "else",         doelse,         0,      INF,
        "end",          doend,          0,      0,
        "endif",        dozip,          0,      0,
        "endsw",        dozip,          0,      0,
+       "eval",         doeval,         0,      INF,
        "exec",         execash,        1,      INF,
        "exit",         doexit,         0,      INF,
        "exec",         execash,        1,      INF,
        "exit",         doexit,         0,      INF,
+       "fg",           dofg,           0,      INF,
        "foreach",      doforeach,      3,      INF,
        "foreach",      doforeach,      3,      INF,
+#ifdef IIASA
+       "gd",           dopushd,        0,      1,
+#endif
        "glob",         doglob,         0,      INF,
        "goto",         dogoto,         1,      1,
        "glob",         doglob,         0,      INF,
        "goto",         dogoto,         1,      1,
+#ifdef VFORK
        "hashstat",     hashstat,       0,      0,
        "hashstat",     hashstat,       0,      0,
-       "history",      dohist,         0,      0,
+#endif
+       "history",      dohist,         0,      2,
        "if",           doif,           1,      INF,
        "if",           doif,           1,      INF,
+       "jobs",         dojobs,         0,      1,
+       "kill",         dokill,         1,      INF,
+       "limit",        dolimit,        0,      3,
        "login",        dologin,        0,      1,
        "logout",       dologout,       0,      0,
        "newgrp",       donewgrp,       1,      1,
        "nice",         donice,         0,      INF,
        "nohup",        donohup,        0,      INF,
        "login",        dologin,        0,      1,
        "logout",       dologout,       0,      0,
        "newgrp",       donewgrp,       1,      1,
        "nice",         donice,         0,      INF,
        "nohup",        donohup,        0,      INF,
+       "notify",       donotify,       0,      INF,
        "onintr",       doonintr,       0,      2,
        "onintr",       doonintr,       0,      2,
+       "popd",         dopopd,         0,      1,
+       "pushd",        dopushd,        0,      1,
+#ifdef IIASA
+       "rd",           dopopd,         0,      1,
+#endif
        "rehash",       dohash,         0,      0,
        "repeat",       dorepeat,       2,      INF,
        "set",          doset,          0,      INF,
        "rehash",       dohash,         0,      0,
        "repeat",       dorepeat,       2,      INF,
        "set",          doset,          0,      INF,
-#ifndef V6
        "setenv",       dosetenv,       2,      2,
        "setenv",       dosetenv,       2,      2,
-#endif
        "shift",        shift,          0,      1,
        "source",       dosource,       1,      1,
        "shift",        shift,          0,      1,
        "source",       dosource,       1,      1,
+       "stop",         dostop,         1,      INF,
+       "suspend",      dosuspend,      0,      0,
        "switch",       doswitch,       1,      INF,
        "time",         dotime,         0,      INF,
        "switch",       doswitch,       1,      INF,
        "time",         dotime,         0,      INF,
-#ifndef V6
        "umask",        doumask,        0,      1,
        "umask",        doumask,        0,      1,
-#endif
        "unalias",      unalias,        1,      INF,
        "unalias",      unalias,        1,      INF,
-       "unhash",       dounhash,               0,      0,
+       "unhash",       dounhash,       0,      0,
+       "unlimit",      dounlimit,      0,      INF,
        "unset",        unset,          1,      INF,
        "unset",        unset,          1,      INF,
-       "wait",         await,          0,      0,
+       "unsetenv",     dounsetenv,     1,      INF,
+       "wait",         dowait,         0,      0,
        "while",        dowhile,        1,      INF,
        0,              0,              0,      0,
 };
        "while",        dowhile,        1,      INF,
        0,              0,              0,      0,
 };
@@ -152,21 +189,41 @@ struct srch {
        0,              0,
 };
 
        0,              0,
 };
 
-char   *mesg[] = {
-       0,
-       "Hangup",
-       0,
-       "Quit",
-       "Illegal instruction",
-       "Trace/BPT trap",
-       "IOT trap",
-       "EMT trap",
-       "Floating exception",
-       "Killed",
-       "Bus error",
-       "Segmentation violation",
-       "Bad system call",
-       0,
-       "Alarm clock",
-       "Terminated",
+struct mesg {
+       char    *iname;
+       char    *pname;
+} mesg[] = {
+       0,      0,
+       "HUP",  "Hangup",
+       "INT",  "Interrupt",    
+       "QUIT", "Quit",
+       "ILL",  "Illegal instruction",
+       "TRAP", "Trace/BPT trap",
+       "IOT",  "IOT trap",
+       "EMT",  "EMT trap",
+       "FPE",  "Floating exception",
+       "KILL", "Killed",
+       "BUS",  "Bus error",
+       "SEGV", "Segmentation fault",
+       "SYS",  "Bad system call",
+       "PIPE", "Broken pipe",
+       "ALRM", "Alarm clock",
+       "TERM", "Terminated",
+       0,      "Signal 16",
+       "STOP", "Stopped (signal)",
+       "TSTP", "Stopped",
+       "CONT", "Continued",
+       "CHLD", "Child exited",
+       "TTIN", "Stopped (tty input)",
+       "TTOU", "Stopped (tty output)",
+       "TINT", "Tty input interrupt",
+       "XCPU", "Cputime limit exceeded",
+       "XFSZ", "Filesize limit exceeded",
+       0,      "Signal 26",
+       0,      "Signal 27",
+       0,      "Signal 28",
+       0,      "Signal 29",
+       0,      "Signal 30",
+       0,      "Signal 31",
+       0,      "Signal 32"
 };
 };