Annotation of researchv9/cmd/sh/msg.c, revision 1.1.1.1

1.1       root        1: /*     @(#)msg.c       1.6     */
                      2: /*
                      3:  *     UNIX shell
                      4:  *
                      5:  *     Bell Telephone Laboratories
                      6:  *
                      7:  */
                      8: 
                      9: 
                     10: #include       "defs.h"
                     11: #include       "sym.h"
                     12: 
                     13: /*
                     14:  * error messages
                     15:  */
                     16: char   badopt[]        = "bad option(s)";
                     17: char   mailmsg[]       = "you have mail\n";
                     18: char   nospace[]       = "no space";
                     19: char   nostack[]       = "no stack space";
                     20: char   synmsg[]        = "syntax error";
                     21: 
                     22: char   badnum[]        = "bad number";
                     23: char   badparam[]      = "parameter null or not set";
                     24: char   unset[]         = "parameter not set";
                     25: char   badsub[]        = "bad substitution";
                     26: char   badcreate[]     = "cannot create";
                     27: char   nofork[]        = "fork failed - too many processes";
                     28: char   noswap[]        = "cannot fork: no swap space";
                     29: char   piperr[]        = "cannot make pipe";
                     30: char   badopen[]       = "cannot open";
                     31: char   coredump[]      = " - core dumped";
                     32: char   arglist[]       = "arg list too long";
                     33: char   txtbsy[]        = "text busy";
                     34: char   toobig[]        = "too big";
                     35: char   badexec[]       = "cannot execute";
                     36: char   notfound[]      = "not found";
                     37: char   notbltin[]      = "not built in";
                     38: char   badfile[]       = "bad file number";
                     39: char   badshift[]      = "cannot shift";
                     40: char   baddir[]        = "bad directory";
                     41: char   badtrap[]       = "bad trap";
                     42: char   notid[]         = "is not an identifier";
                     43: char   badreturn[]     = "cannot return when not in function";
                     44: char   badexport[]     = "cannot export functions";
                     45: char   badunset[]      = "cannot unset";
                     46: char   nohome[]        = "no home directory";
                     47: char   badperm[]       = "execute permission denied";
                     48: char   badfname[]      = "illegal function name";
                     49: /*
                     50:  * built in names
                     51:  */
                     52: char   pathname[]      = "PATH";
                     53: char   cdpname[]       = "CDPATH";
                     54: char   homename[]      = "HOME";
                     55: char   mailname[]      = "MAIL";
                     56: char   ifsname[]       = "IFS";
                     57: char   ps1name[]       = "PS1";
                     58: char   ps2name[]       = "PS2";
                     59: char   acctname[]      = "SHACCT";
                     60: char   histname[]      = "HISTORY";
                     61: 
                     62: /*
                     63:  * string constants
                     64:  */
                     65: char   nullstr[]       = "";
                     66: char   sptbnl[]        = " \t\n";
                     67: char   defpath[]       = ":/bin:/usr/bin";
                     68: char   colon[]         = ": ";
                     69: char   minus[]         = "-";
                     70: char   endoffile[]     = "end of file";
                     71: char   unexpected[]    = " unexpected";
                     72: char   atline[]        = " at line ";
                     73: char   devnull[]       = "/dev/null";
                     74: char   execpmsg[]      = "+ ";
                     75: char   readmsg[]       = "> ";
                     76: char   stdprompt[]     = "$ ";
                     77: char   supprompt[]     = "# ";
                     78: char   profile[]       = ".profile";
                     79: 
                     80: /*
                     81:  * tables
                     82:  */
                     83: 
                     84: struct sysnod reserved[] =
                     85: {
                     86:        { "case",       CASYM   },
                     87:        { "do",         DOSYM   },
                     88:        { "done",       ODSYM   },
                     89:        { "elif",       EFSYM   },
                     90:        { "else",       ELSYM   },
                     91:        { "esac",       ESSYM   },
                     92:        { "fi",         FISYM   },
                     93:        { "for",        FORSYM  },
                     94:        { "if",         IFSYM   },
                     95:        { "in",         INSYM   },
                     96:        { "then",       THSYM   },
                     97:        { "until",      UNSYM   },
                     98:        { "while",      WHSYM   },
                     99: };
                    100: 
                    101: int no_reserved = 13;
                    102: 
                    103: char   *sysmsg[] =
                    104: {
                    105:        0,
                    106:        "Hangup",
                    107:        0,      /* Interrupt */
                    108:        "Quit",
                    109:        "Illegal instruction",
                    110:        "Trace/BPT trap",
                    111: #ifdef CRAY
                    112: #ifdef CRAY2
                    113:        "Hardware error",
                    114: #else
                    115:        "Signal 6",
                    116: #endif
                    117:        "Error exit",
                    118: #else
                    119:        "abort",
                    120:        "EMT trap",
                    121: #endif
                    122:        "Floating exception",
                    123:        "Killed",
                    124: #ifdef CRAY
                    125:        "Program range error",
                    126:        "Operand range error",
                    127: #else
                    128:        "Bus error",
                    129:        "Memory fault",
                    130: #endif
                    131:        "Bad system call",
                    132:        0,      /* Broken pipe */
                    133:        "Alarm call",
                    134:        "Terminated",
                    135:        "Signal 16",
                    136:        "Signal 17",
                    137:        "Child death",
                    138: #ifdef CRAY
                    139:        "Signal 19",
                    140:        "Signal 20",
                    141:        "Signal 21",
                    142:        "Signal 22",
                    143:        "Signal 23",
                    144:        "Signal 24",
                    145:        "Signal 25",
                    146:        "Signal 26",
                    147:        "Signal 27",
                    148:        "Signal 28",
                    149:        "Signal 29",
                    150:        "Signal 30",
                    151:        "Signal 31",
                    152:        "Signal 32",
                    153:        "Signal 33",
                    154:        "Signal 34",
                    155:        "Signal 35",
                    156:        "Signal 36",
                    157:        "Signal 37",
                    158:        "Signal 38",
                    159:        "Signal 39",
                    160:        "Signal 40",
                    161:        "Signal 41",
                    162:        "Signal 42",
                    163:        "Signal 43",
                    164:        "Signal 44",
                    165:        "Signal 45",
                    166:        "Signal 46",
                    167:        "Signal 47",
                    168:        "Signal 48",
                    169:        "Signal 49",
                    170:        "Signal 50",
                    171:        "Signal 51",
                    172:        "Signal 52",
                    173:        "Signal 53",
                    174:        "Signal 54",
                    175:        "Signal 55",
                    176:        "Signal 56",
                    177:        "Signal 57",
                    178:        "Signal 58",
                    179:        "Signal 59",
                    180:        "Signal 60",
                    181:        "Signal 61",
                    182:        "Signal 62",
                    183:        "Signal 63"
                    184: #else
                    185:        "Power Fail"
                    186: #endif
                    187: };
                    188: 
                    189: char   export[] = "export";
                    190: char   duperr[] = "cannot dup";
                    191: 
                    192: struct sysnod commands[] =
                    193: {
                    194:        { ".",          SYSDOT  },
                    195:        { ":",          SYSNULL },
                    196:        { "break",      SYSBREAK },
                    197:        { "builtin",    SYSBLTIN },
                    198:        { "cd",         SYSCD   },
                    199:        { "continue",   SYSCONT },
                    200:        { "eval",       SYSEVAL },
                    201:        { "exec",       SYSEXEC },
                    202:        { "exit",       SYSEXIT },
                    203:        { "export",     SYSXPORT },
                    204:        { "newgrp",     SYSNEWGRP },
                    205:        { "read",       SYSREAD },
                    206:        { "return",     SYSRETURN },
                    207:        { "set",        SYSSET  },
                    208:        { "shift",      SYSSHFT },
                    209:        { "times",      SYSTIMES },
                    210:        { "trap",       SYSTRAP },
                    211:        { "umask",      SYSUMASK },
                    212:        { "unset",      SYSUNS },
                    213:        { "wait",       SYSWAIT },
                    214:        { "whatis",     SYSWHATIS },
                    215:        { "xxmem",      SYSMEM }
                    216: };
                    217: 
                    218: int no_commands = sizeof(commands)/sizeof(commands[0]);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.