modern syntax for asgops & inits cause Donn's latest ccom rejects the old.
[unix-history] / usr / src / bin / csh / init.c
index 67fab3a..33654e7 100644 (file)
@@ -1,4 +1,12 @@
-static char *sccsid = "@(#)init.c 4.1 %G%";
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley Software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)init.c      5.2 (Berkeley) %G%";
+#endif
 
 #include "sh.local.h"
 
 
 #include "sh.local.h"
 
@@ -32,7 +40,9 @@ extern        int dolet();
 extern int dolimit();
 extern int dologin();
 extern int dologout();
 extern int dolimit();
 extern int dologin();
 extern int dologout();
+#ifdef NEWGRP
 extern int donewgrp();
 extern int donewgrp();
+#endif
 extern int donice();
 extern int donotify();
 extern int donohup();
 extern int donice();
 extern int donotify();
 extern int donohup();
@@ -74,9 +84,7 @@ struct        biltins {
 } bfunc[] = {
        "@",            dolet,          0,      INF,
        "alias",        doalias,        0,      INF,
 } bfunc[] = {
        "@",            dolet,          0,      INF,
        "alias",        doalias,        0,      INF,
-#ifdef debug
        "alloc",        showall,        0,      1,
        "alloc",        showall,        0,      1,
-#endif
        "bg",           dobg,           0,      INF,
        "break",        dobreak,        0,      0,
        "breaksw",      doswbrk,        0,      0,
        "bg",           dobg,           0,      INF,
        "break",        dobreak,        0,      0,
        "breaksw",      doswbrk,        0,      0,
@@ -114,7 +122,9 @@ struct      biltins {
        "limit",        dolimit,        0,      3,
        "login",        dologin,        0,      1,
        "logout",       dologout,       0,      0,
        "limit",        dolimit,        0,      3,
        "login",        dologin,        0,      1,
        "logout",       dologout,       0,      0,
+#ifdef NEWGRP
        "newgrp",       donewgrp,       1,      1,
        "newgrp",       donewgrp,       1,      1,
+#endif
        "nice",         donice,         0,      INF,
        "nohup",        donohup,        0,      INF,
        "notify",       donotify,       0,      INF,
        "nice",         donice,         0,      INF,
        "nohup",        donohup,        0,      INF,
        "notify",       donotify,       0,      INF,
@@ -127,9 +137,9 @@ struct      biltins {
        "rehash",       dohash,         0,      0,
        "repeat",       dorepeat,       2,      INF,
        "set",          doset,          0,      INF,
        "rehash",       dohash,         0,      0,
        "repeat",       dorepeat,       2,      INF,
        "set",          doset,          0,      INF,
-       "setenv",       dosetenv,       2,      2,
+       "setenv",       dosetenv,       0,      2,
        "shift",        shift,          0,      1,
        "shift",        shift,          0,      1,
-       "source",       dosource,       1,      1,
+       "source",       dosource,       1,      2,
        "stop",         dostop,         1,      INF,
        "suspend",      dosuspend,      0,      0,
        "switch",       doswitch,       1,      INF,
        "stop",         dostop,         1,      INF,
        "suspend",      dosuspend,      0,      0,
        "switch",       doswitch,       1,      INF,
@@ -142,8 +152,8 @@ struct      biltins {
        "unsetenv",     dounsetenv,     1,      INF,
        "wait",         dowait,         0,      0,
        "while",        dowhile,        1,      INF,
        "unsetenv",     dounsetenv,     1,      INF,
        "wait",         dowait,         0,      0,
        "while",        dowhile,        1,      INF,
-       0,              0,              0,      0,
 };
 };
+int nbfunc = sizeof bfunc / sizeof *bfunc;
 
 #define        ZBREAK          0
 #define        ZBRKSW          1
 
 #define        ZBREAK          0
 #define        ZBRKSW          1
@@ -186,8 +196,8 @@ struct srch {
        "set",          ZSET,
        "switch",       ZSWITCH,
        "while",        ZWHILE,
        "set",          ZSET,
        "switch",       ZSWITCH,
        "while",        ZWHILE,
-       0,              0,
 };
 };
+int nsrchn = sizeof srchn / sizeof *srchn;
 
 struct mesg {
        char    *iname;
 
 struct mesg {
        char    *iname;
@@ -209,21 +219,21 @@ struct    mesg {
        "PIPE", "Broken pipe",
        "ALRM", "Alarm clock",
        "TERM", "Terminated",
        "PIPE", "Broken pipe",
        "ALRM", "Alarm clock",
        "TERM", "Terminated",
-       0,      "Signal 16",
+       "URG",  "Urgent I/O condition",
        "STOP", "Stopped (signal)",
        "TSTP", "Stopped",
        "CONT", "Continued",
        "CHLD", "Child exited",
        "TTIN", "Stopped (tty input)",
        "TTOU", "Stopped (tty output)",
        "STOP", "Stopped (signal)",
        "TSTP", "Stopped",
        "CONT", "Continued",
        "CHLD", "Child exited",
        "TTIN", "Stopped (tty input)",
        "TTOU", "Stopped (tty output)",
-       "TINT", "Tty input interrupt",
+       "IO",   "I/O possible",
        "XCPU", "Cputime limit exceeded",
        "XFSZ", "Filesize limit exceeded",
        "XCPU", "Cputime limit exceeded",
        "XFSZ", "Filesize limit exceeded",
-       0,      "Signal 26",
-       0,      "Signal 27",
-       0,      "Signal 28",
+       "VTALRM","Virtual timer expired",
+       "PROF", "Profiling timer expired",
+       "WINCH","Window size changed",
        0,      "Signal 29",
        0,      "Signal 29",
-       0,      "Signal 30",
-       0,      "Signal 31",
+       "USR1", "User defined signal 1",
+       "USR2", "User defined signal 2",
        0,      "Signal 32"
 };
        0,      "Signal 32"
 };