don't allow -d random, so "make -d file" fails.
[unix-history] / usr / src / bin / csh / init.c
index 30f529f..4fa1b29 100644 (file)
@@ -1,6 +1,14 @@
-static char *sccsid = "@(#)init.c 4.2 %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.
+ */
 
 
-#include "sh.local.h"
+#ifndef lint
+static char *sccsid = "@(#)init.c      5.5 (Berkeley) %G%";
+#endif
+
+#include "sh.h"
 
 /*
  * C shell
 
 /*
  * C shell
@@ -32,7 +40,6 @@ extern        int dolet();
 extern int dolimit();
 extern int dologin();
 extern int dologout();
 extern int dolimit();
 extern int dologin();
 extern int dologout();
-extern int donewgrp();
 extern int donice();
 extern int donotify();
 extern int donohup();
 extern int donice();
 extern int donotify();
 extern int donohup();
@@ -67,22 +74,13 @@ extern      int dounsetenv();
 
 #define        INF     1000
 
 
 #define        INF     1000
 
-struct biltins {
-       char    *bname;
-       int     (*bfunct)();
-       short   minargs, maxargs;
-} bfunc[] = {
+struct biltins bfunc[] = {
        "@",            dolet,          0,      INF,
        "alias",        doalias,        0,      INF,
        "@",            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,
-#ifdef IIASA
-       "bye",          goodbye,        0,      0,
-#endif
        "case",         dozip,          0,      1,
        "cd",           dochngd,        0,      1,
        "chdir",        dochngd,        0,      1,
        "case",         dozip,          0,      1,
        "cd",           dochngd,        0,      1,
        "chdir",        dochngd,        0,      1,
@@ -99,9 +97,6 @@ struct        biltins {
        "exit",         doexit,         0,      INF,
        "fg",           dofg,           0,      INF,
        "foreach",      doforeach,      3,      INF,
        "exit",         doexit,         0,      INF,
        "fg",           dofg,           0,      INF,
        "foreach",      doforeach,      3,      INF,
-#ifdef IIASA
-       "gd",           dopushd,        0,      1,
-#endif
        "glob",         doglob,         0,      INF,
        "goto",         dogoto,         1,      1,
 #ifdef VFORK
        "glob",         doglob,         0,      INF,
        "goto",         dogoto,         1,      1,
 #ifdef VFORK
@@ -114,20 +109,16 @@ 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,
-       "newgrp",       donewgrp,       1,      1,
        "nice",         donice,         0,      INF,
        "nohup",        donohup,        0,      INF,
        "notify",       donotify,       0,      INF,
        "onintr",       doonintr,       0,      2,
        "popd",         dopopd,         0,      1,
        "pushd",        dopushd,        0,      1,
        "nice",         donice,         0,      INF,
        "nohup",        donohup,        0,      INF,
        "notify",       donotify,       0,      INF,
        "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,
-       "setenv",       dosetenv,       2,      2,
+       "setenv",       dosetenv,       0,      2,
        "shift",        shift,          0,      1,
        "source",       dosource,       1,      2,
        "stop",         dostop,         1,      INF,
        "shift",        shift,          0,      1,
        "source",       dosource,       1,      2,
        "stop",         dostop,         1,      INF,
@@ -142,33 +133,10 @@ 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        ZCASE           2
-#define        ZDEFAULT        3
-#define        ZELSE           4
-#define        ZEND            5
-#define        ZENDIF          6
-#define        ZENDSW          7
-#define        ZEXIT           8
-#define        ZFOREACH        9
-#define        ZGOTO           10
-#define        ZIF             11
-#define        ZLABEL          12
-#define        ZLET            13
-#define        ZSET            14
-#define        ZSWITCH         15
-#define        ZTEST           16
-#define        ZTHEN           17
-#define        ZWHILE          18
-
-struct srch {
-       char    *s_name;
-       short   s_value;
-} srchn[] = {
+struct srch srchn[] = {
        "@",            ZLET,
        "break",        ZBREAK,
        "breaksw",      ZBRKSW,
        "@",            ZLET,
        "break",        ZBREAK,
        "breaksw",      ZBRKSW,
@@ -186,13 +154,10 @@ 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;
-       char    *pname;
-} mesg[] = {
+struct mesg mesg[] = {
        0,      0,
        "HUP",  "Hangup",
        "INT",  "Interrupt",    
        0,      0,
        "HUP",  "Hangup",
        "INT",  "Interrupt",    
@@ -209,21 +174,21 @@ struct    mesg {
        "PIPE", "Broken pipe",
        "ALRM", "Alarm clock",
        "TERM", "Terminated",
        "PIPE", "Broken pipe",
        "ALRM", "Alarm clock",
        "TERM", "Terminated",
-       0,      "Signal 16",
-       "STOP", "Stopped (signal)",
-       "TSTP", "Stopped",
+       "URG",  "Urgent I/O condition",
+       "STOP", "Suspended (signal)",
+       "TSTP", "Suspended",
        "CONT", "Continued",
        "CHLD", "Child exited",
        "CONT", "Continued",
        "CHLD", "Child exited",
-       "TTIN", "Stopped (tty input)",
-       "TTOU", "Stopped (tty output)",
-       "TINT", "Tty input interrupt",
+       "TTIN", "Suspended (tty input)",
+       "TTOU", "Suspended (tty output)",
+       "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"
 };