home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Shells / zsh-3.0.5-MIHS / src / Src / globals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-03  |  19.2 KB  |  796 lines

  1. /*
  2.  * $Id: globals.h,v 2.44 1996/10/15 20:16:35 hzoli Exp $
  3.  *
  4.  * globals.h - global variables for zsh
  5.  *
  6.  * This file is part of zsh, the Z shell.
  7.  *
  8.  * Copyright (c) 1992-1996 Paul Falstad
  9.  * All rights reserved.
  10.  *
  11.  * Permission is hereby granted, without written agreement and without
  12.  * license or royalty fees, to use, copy, modify, and distribute this
  13.  * software and to distribute modified versions of this software for any
  14.  * purpose, provided that the above copyright notice and the following
  15.  * two paragraphs appear in all copies of this software.
  16.  *
  17.  * In no event shall Paul Falstad or the Zsh Development Group be liable
  18.  * to any party for direct, indirect, special, incidental, or consequential
  19.  * damages arising out of the use of this software and its documentation,
  20.  * even if Paul Falstad and the Zsh Development Group have been advised of
  21.  * the possibility of such damage.
  22.  *
  23.  * Paul Falstad and the Zsh Development Group specifically disclaim any
  24.  * warranties, including, but not limited to, the implied warranties of
  25.  * merchantability and fitness for a particular purpose.  The software
  26.  * provided hereunder is on an "as is" basis, and Paul Falstad and the
  27.  * Zsh Development Group have no obligation to provide maintenance,
  28.  * support, updates, enhancements, or modifications.
  29.  *
  30.  */
  31.  
  32.  
  33. /* GLOBALS is defined is init.c, so the global variables *
  34.  * are actually contained in init.c, and are externs in  *
  35.  * the other source files.                               */
  36.  
  37. #ifdef GLOBALS
  38. # define EXTERN
  39. #else
  40. # define EXTERN extern
  41. #endif
  42.  
  43. #ifdef GLOBALS
  44. int redirtab[TRINANG - OUTANG + 1] =
  45. {
  46.     WRITE,
  47.     WRITENOW,
  48.     APP,
  49.     APPNOW,
  50.     READ,
  51.     READWRITE,
  52.     HEREDOC,
  53.     HEREDOCDASH,
  54.     MERGEIN,
  55.     MERGEOUT,
  56.     ERRWRITE,
  57.     ERRWRITENOW,
  58.     ERRAPP,
  59.     ERRAPPNOW,
  60.     HERESTR,
  61. };
  62. #else
  63. extern int redirtab[TRINANG - OUTANG + 1];
  64. #endif
  65.  
  66. #ifdef GLOBALS
  67. char nulstring[] = {Nularg, '\0'};
  68. int  nulstrlen   = sizeof(nulstring) - 1;
  69. #else
  70. extern char nulstring[];
  71. extern int  nulstrlen;
  72. #endif
  73.  
  74. /* NULL-terminated arrays containing path, cdpath, etc. */
  75.  
  76. EXTERN char **path;        /* $path     */
  77. EXTERN char **cdpath;        /* $cdpath   */
  78. EXTERN char **fpath;        /* $fpath    */
  79. EXTERN char **watch;        /* $watch    */
  80. EXTERN char **mailpath;        /* $mailpath */
  81. EXTERN char **manpath;        /* $manpath  */
  82. EXTERN char **fignore;        /* $fignore  */
  83. EXTERN char **psvar;        /* $psvar    */
  84.  
  85. EXTERN char *yytext;
  86.  
  87. /* used to suppress ERREXIT and  *
  88.  * trapping of SIGZERR, SIGEXIT. */
  89.  
  90. EXTERN int noerrexit;
  91.  
  92. /* do not save history on exec and exit */
  93.  
  94. EXTERN int nohistsave;
  95.  
  96. /* error/break flag */
  97.  
  98. EXTERN int errflag;
  99.  
  100. /* Status of return from a trap */
  101.  
  102. EXTERN int trapreturn;
  103.  
  104. EXTERN char *tokstr;
  105. EXTERN int tok, tokfd;
  106.  
  107. /* lexical analyzer error flag */
  108.  
  109. EXTERN int lexstop;
  110.  
  111. EXTERN struct heredocs *hdocs;
  112.  
  113. /* suppress error messages */
  114.  
  115. EXTERN int noerrs;
  116.  
  117. /* nonzero means we are not evaluating, just parsing (in math.c) */
  118.  
  119. EXTERN int noeval;
  120.  
  121. /* current history event number */
  122.  
  123. EXTERN int curhist;
  124.  
  125. /* if != 0, we are expanding the current line */
  126.  
  127. EXTERN int expanding;
  128.  
  129. /* these are used to modify the cursor position during expansion */
  130.  
  131. EXTERN int excs, exlast;
  132.  
  133. /* if != 0, this is the first line of the command */
  134.  
  135. EXTERN int isfirstln;
  136.  
  137. /* if != 0, this is the first char of the command (not including
  138.         white space) */
  139.  
  140. EXTERN int isfirstch;
  141.  
  142. /* number of history entries */
  143.  
  144. EXTERN int histentct;
  145.  
  146. /* array of history entries */
  147.  
  148. EXTERN Histent histentarr;
  149.  
  150. /* capacity of history lists */
  151.  
  152. EXTERN int histsiz;
  153.  
  154. /* if = 1, we have performed history substitution on the current line
  155.         if = 2, we have used the 'p' modifier */
  156.  
  157. EXTERN int histdone;
  158.  
  159. /* default event (usually curhist-1, that is, "!!") */
  160.  
  161. EXTERN int defev;
  162.  
  163. /* != 0 if we are about to read a command word */
  164.  
  165. EXTERN int incmdpos;
  166.  
  167. /* != 0 if we are in the middle of a [[ ... ]] */
  168.  
  169. EXTERN int incond;
  170.  
  171. /* != 0 if we are after a redirection (for ctxtlex only) */
  172.  
  173. EXTERN int inredir;
  174.  
  175. /* != 0 if we are about to read a case pattern */
  176.  
  177. EXTERN int incasepat;
  178.  
  179. /* != 0 if we just read FUNCTION */
  180.  
  181. EXTERN int infunc;
  182.  
  183. /* != 0 if we just read a newline */
  184.  
  185. EXTERN int isnewlin;
  186.  
  187. /* the lists of history events */
  188.  
  189. EXTERN LinkList histlist;
  190.  
  191. /* the directory stack */
  192.  
  193. EXTERN LinkList dirstack;
  194.  
  195. /* the zle buffer stack */
  196.  
  197. EXTERN LinkList bufstack;
  198.  
  199. /* total # of characters waiting to be read. */
  200.  
  201. EXTERN int inbufct;
  202.  
  203. /* the flags controlling the input routines in input.c: see INP_* in zsh.h */
  204.  
  205. EXTERN int inbufflags;
  206.  
  207. /* flag that an alias should be expanded after expansion ending in space */
  208.  
  209. EXTERN int inalmore;
  210.  
  211. /* != 0 if this is a subshell */
  212.  
  213. EXTERN int subsh;
  214.  
  215. /* # of break levels */
  216.  
  217. EXTERN int breaks;
  218.  
  219. /* != 0 if we have a return pending */
  220.  
  221. EXTERN int retflag;
  222.  
  223. /* how far we've hashed the PATH so far */
  224.  
  225. EXTERN char **pathchecked;
  226.  
  227. /* # of nested loops we are in */
  228.  
  229. EXTERN int loops;
  230.  
  231. /* # of continue levels */
  232.  
  233. EXTERN int contflag;
  234.  
  235. /* the job we are working on */
  236.  
  237. EXTERN int thisjob;
  238.  
  239. /* the current job (+) */
  240.  
  241. EXTERN int curjob;
  242.  
  243. /* the previous job (-) */
  244.  
  245. EXTERN int prevjob;
  246.  
  247. /* hash table containing the aliases */
  248.  
  249. EXTERN HashTable aliastab;
  250.  
  251. /* hash table containing the reserved words */
  252.  
  253. EXTERN HashTable reswdtab;
  254.  
  255. /* hash table containing the parameters */
  256.  
  257. EXTERN HashTable paramtab;
  258.  
  259. /* hash table containing the external/hashed commands */
  260.  
  261. EXTERN HashTable cmdnamtab;
  262.  
  263. /* hash table containing the shell functions */
  264.  
  265. EXTERN HashTable shfunctab;
  266.  
  267. /* hash table containing builtin commands */
  268.  
  269. EXTERN HashTable builtintab;
  270.  
  271. /* hash table for completion info for commands */
  272.  
  273. EXTERN HashTable compctltab;
  274.  
  275. /* hash table for multi-character bindings */
  276.  
  277. EXTERN HashTable keybindtab;
  278.  
  279. /* hash table for emacs multi-character bindings */
  280.  
  281. EXTERN HashTable emkeybindtab;
  282.  
  283. /* hash table for vi multi-character bindings */
  284.  
  285. EXTERN HashTable vikeybindtab;
  286.  
  287. /* hash table for named directories */
  288.  
  289. EXTERN HashTable nameddirtab;
  290.  
  291. /* default completion infos */
  292.  
  293. EXTERN struct compctl cc_compos, cc_default, cc_first, cc_dummy;
  294.  
  295. /* the job table */
  296.  
  297. EXTERN struct job jobtab[MAXJOB];
  298.  
  299. /* shell timings */
  300.  
  301. EXTERN struct tms shtms;
  302.  
  303. /* the list of sched jobs pending */
  304.  
  305. EXTERN struct schedcmd *schedcmds;
  306.  
  307. /* the last l for s/l/r/ history substitution */
  308.  
  309. EXTERN char *hsubl;
  310.  
  311. /* the last r for s/l/r/ history substitution */
  312.  
  313. EXTERN char *hsubr;
  314.  
  315. /* We cache `USERNAME' and use check cached_uid *
  316.  * so we know when to recompute it.             */
  317.  
  318. EXTERN uid_t cached_uid;
  319. EXTERN char *cached_username;   /* $USERNAME   */
  320. EXTERN char *zsh_name;        /* ZSH_NAME    */
  321.  
  322. EXTERN char *underscore;    /* $_          */
  323. EXTERN long lastval;            /* $?          */
  324. EXTERN long mypid;        /* $$          */
  325. EXTERN long lastpid;        /* $!          */
  326. EXTERN long ppid;        /* $PPID       */
  327. EXTERN char *ifs;        /* $IFS        */
  328. EXTERN char *pwd;        /* $PWD        */
  329. EXTERN char *oldpwd;        /* $OLDPWD     */
  330.  
  331. EXTERN long columns;            /* $COLUMNS    */
  332. EXTERN long lines;              /* $LINES      */
  333.  
  334. EXTERN char *zoptarg;        /* $OPTARG     */
  335. EXTERN long zoptind;        /* $OPTIND     */
  336. EXTERN char *prompt;        /* $PROMPT     */
  337. EXTERN char *prompt2;        /* etc.        */
  338. EXTERN char *prompt3;
  339. EXTERN char *prompt4;
  340. EXTERN char *rprompt;        /* $RPROMPT    */
  341. EXTERN char *sprompt;
  342.  
  343. EXTERN char *wordchars;
  344. EXTERN char *rstring, *Rstring;
  345. EXTERN char *postedit;
  346.  
  347. EXTERN char *hostnam;           /* from gethostname */
  348. EXTERN char *home;              /* $HOME */
  349. EXTERN char **pparams;          /* $argv */
  350.  
  351. EXTERN pid_t mypgrp;        /* the process group of the shell */
  352.  
  353. EXTERN char *argzero;           /* $0 */
  354.  
  355. EXTERN char *hackzero;
  356. EXTERN char *scriptname;        /* name of script being sourced */
  357.  
  358. EXTERN long lineno;             /* $LINENO       */
  359. EXTERN long shlvl;              /* $SHLVL        */
  360.  
  361. EXTERN long lastval2;
  362.  
  363. /* the last time we checked mail */
  364.  
  365. EXTERN time_t lastmailcheck;
  366.  
  367. /* the last time we checked the people in the WATCH variable */
  368.  
  369. EXTERN time_t lastwatch;
  370.  
  371. /* the last time we did the periodic() shell function */
  372.  
  373. EXTERN time_t lastperiodic;
  374.  
  375. /* $SECONDS = time(NULL) - shtimer.tv_sec */
  376.  
  377. EXTERN struct timeval shtimer;
  378.  
  379. /* the default command for null commands */
  380.  
  381. EXTERN char *nullcmd;
  382. EXTERN char *readnullcmd;
  383.  
  384. /* the List of local variables we have to destroy */
  385.  
  386. EXTERN LinkList locallist;
  387.  
  388. /* what level of localness we are at */
  389.  
  390. EXTERN int locallevel;
  391.  
  392. /* what level of sourcing we are at */
  393.  
  394. EXTERN int sourcelevel;
  395.  
  396. /* The table of file descriptors.  A table element is zero if the  *
  397.  * corresponding fd is not used by the shell.  It is greater than  *
  398.  * 1 if the fd is used by a <(...) or >(...) substitution and 1 if *
  399.  * it is an internal file descriptor which must be closed before   *
  400.  * executing an external command.  The first ten elements of the   *
  401.  * table is not used.  A table element is set by movefd and cleard *
  402.  * by zclose.                                                      */
  403.  
  404. EXTERN char *fdtable;
  405.  
  406. /* The allocated size of fdtable */
  407.  
  408. EXTERN int fdtable_size;
  409.  
  410. /* The highest fd that marked with nonzero in fdtable */
  411.  
  412. EXTERN int max_zsh_fd;
  413.  
  414. /* input fd from the coprocess */
  415.  
  416. EXTERN int coprocin;
  417.  
  418. /* output fd from the coprocess */
  419.  
  420. EXTERN int coprocout;
  421.  
  422. /* the shell input fd */
  423.  
  424. EXTERN int SHIN;
  425.  
  426. /* the shell tty fd */
  427.  
  428. EXTERN int SHTTY;
  429.  
  430. /* the FILE attached to the shell tty */
  431.  
  432. EXTERN FILE *shout;
  433.  
  434. /* buffered shell input for non-interactive shells */
  435.  
  436. EXTERN FILE *bshin;
  437.  
  438. /* != 0 means we are reading input from a string */
  439.  
  440. EXTERN int strin;
  441.  
  442. /* != 0 means history substitution is turned off */
  443.  
  444. EXTERN int stophist;
  445.  
  446. /* this line began with a space, so junk it if HISTIGNORESPACE is on */
  447.  
  448. EXTERN int spaceflag;
  449.  
  450. /* don't do spelling correction */
  451.  
  452. EXTERN int nocorrect;
  453.  
  454. /* state of the history mechanism (see hist.c) */
  455.  
  456. EXTERN int histactive;
  457.  
  458. /* current emulation (used to decide which set of option letters is used) */
  459.  
  460. EXTERN int emulation;
  461.  
  462. /* the options; e.g. if opts[SHGLOB] != 0, SH_GLOB is turned on */
  463.  
  464. EXTERN char opts[OPT_SIZE];
  465.  
  466. EXTERN int lastbase;            /* last input base we used */
  467.  
  468. #ifdef HAVE_GETRLIMIT
  469. /* the resource limits for the shell and its children */
  470.  
  471. EXTERN struct rlimit current_limits[RLIM_NLIMITS];
  472. EXTERN struct rlimit limits[RLIM_NLIMITS];
  473. #endif
  474.  
  475. /* pointer into the history line */
  476.  
  477. EXTERN char *hptr;
  478.  
  479. /* the current history line */
  480.  
  481. EXTERN char *chline;
  482.  
  483. /* true if the last character returned by hgetc was an escaped bangchar
  484.  * if it is set and NOBANGHIST is unset hwaddc escapes bangchars */
  485.  
  486. EXTERN int qbang;
  487.  
  488. /* text attribute mask */
  489.  
  490. #ifdef GLOBALS
  491. unsigned txtattrmask = 0;
  492. #else
  493. extern unsigned txtattrmask;
  494. #endif
  495.  
  496. /* text change - attribute change made by prompts */
  497.  
  498. EXTERN unsigned txtchange;
  499.  
  500. EXTERN char *term;        /* $TERM */
  501.  
  502. /* 0 if this $TERM setup is usable, otherwise it contains TERM_* flags */
  503.  
  504. EXTERN int termflags;
  505.  
  506. /* flag for CSHNULLGLOB */
  507.  
  508. EXTERN int badcshglob;
  509.  
  510. /* max size of histline */
  511.  
  512. EXTERN int hlinesz;
  513.  
  514. /* we have printed a 'you have stopped (running) jobs.' message */
  515.  
  516. EXTERN int stopmsg;
  517.  
  518. /* the default tty state */
  519.  
  520. EXTERN struct ttyinfo shttyinfo;
  521.  
  522. EXTERN char *ttystrname;    /* $TTY */
  523.  
  524. /* 1 if ttyctl -f has been executed */
  525.  
  526. EXTERN int ttyfrozen;
  527.  
  528. /* != 0 if we are allocating in the heaplist */
  529.  
  530. EXTERN int useheap;
  531.  
  532. /* Words on the command line, for use in completion */
  533.  
  534. EXTERN int clwsize, clwnum, clwpos;
  535. EXTERN char **clwords;
  536.  
  537. /* pid of process undergoing 'process substitution' */
  538.  
  539. EXTERN pid_t cmdoutpid;
  540.  
  541. /* exit status of process undergoing 'process substitution' */
  542.  
  543. EXTERN int cmdoutval;
  544.  
  545. /* Stack to save some variables before executing a signal handler function */
  546.  
  547. EXTERN struct execstack *exstack;
  548.  
  549. /* Array describing the state of each signal: an element contains *
  550.  * 0 for the default action or some ZSIG_* flags ored together.   */
  551.  
  552. EXTERN int sigtrapped[VSIGCOUNT];
  553.  
  554. /* trap functions for each signal */
  555.  
  556. EXTERN List sigfuncs[VSIGCOUNT];
  557.  
  558. #ifdef DEBUG
  559. EXTERN int alloc_stackp;
  560. #endif
  561.  
  562. /* Variables used by signal queueing */
  563.  
  564. EXTERN int queueing_enabled;
  565. EXTERN sigset_t signal_mask_queue[MAX_QUEUE_SIZE];
  566. EXTERN int signal_queue[MAX_QUEUE_SIZE];
  567. EXTERN int queue_front;
  568. EXTERN int queue_rear;
  569.  
  570. /* 1 if aliases should not be expanded */
  571.  
  572. EXTERN int noaliases;
  573.  
  574. #ifdef GLOBALS
  575. /* tokens */
  576. char *ztokens = "#$^*()$=|{}[]`<>?~`,'\"\\";
  577. #else
  578. extern char *ztokens;
  579. #endif
  580.  
  581. /* $histchars */
  582.  
  583. EXTERN unsigned char bangchar, hatchar, hashchar;
  584.  
  585. EXTERN int eofseen;
  586.  
  587. /* we are parsing a line sent to use by the editor */
  588.  
  589. EXTERN int zleparse;
  590.  
  591. EXTERN int wordbeg;
  592.  
  593. EXTERN int parbegin;
  594.  
  595. EXTERN int parend;
  596.  
  597. /* used in arrays of lists instead of NULL pointers */
  598.  
  599. EXTERN struct list dummy_list;
  600.  
  601. /* lengths of each string */
  602.  
  603. EXTERN int tclen[TC_COUNT];
  604.  
  605. EXTERN char *tcstr[TC_COUNT];
  606.  
  607. /* Values of the li and co entries */
  608.  
  609. EXTERN int tclines, tccolumns;
  610.  
  611. /* names of the strings we want */
  612. #ifdef GLOBALS
  613. char *tccapnams[TC_COUNT] =
  614. {
  615.     "cl", "le", "LE", "nd", "RI", "up", "UP", "do",
  616.     "DO", "dc", "DC", "ic", "IC", "cd", "ce", "al", "dl", "ta",
  617.     "md", "so", "us", "me", "se", "ue"
  618. };
  619. #else
  620. extern char *tccapnams[TC_COUNT];
  621. #endif
  622.  
  623. /* the command stack for use with %_ in prompts */
  624.  
  625. EXTERN unsigned char *cmdstack;
  626. EXTERN int cmdsp;
  627.  
  628. #ifdef GLOBALS
  629. char *tokstrings[WHILE + 1] = {
  630.     NULL,    /* NULLTOK      0  */
  631.     ";",    /* SEPER         */
  632.     "\\n",    /* NEWLIN         */
  633.     ";",    /* SEMI             */
  634.     ";;",    /* DSEMI         */
  635.     "&",    /* AMPER      5  */
  636.     "(",    /* INPAR         */
  637.     ")",    /* OUTPAR         */
  638.     "||",    /* DBAR             */
  639.     "&&",    /* DAMPER         */
  640.     ")",    /* OUTANG      10 */
  641.     ">|",    /* OUTANGBANG         */
  642.     ">>",    /* DOUTANG         */
  643.     ">>|",    /* DOUTANGBANG         */
  644.     "<",    /* INANG         */
  645.     "<>",    /* INOUTANG      15 */
  646.     "<<",    /* DINANG         */
  647.     "<<-",    /* DINANGDASH         */
  648.     "<&",    /* INANGAMP         */
  649.     ">&",    /* OUTANGAMP         */
  650.     "&>",    /* AMPOUTANG      20 */
  651.     "&>|",    /* OUTANGAMPBANG     */
  652.     ">>&",    /* DOUTANGAMP         */
  653.     ">>&|",    /* DOUTANGAMPBANG    */
  654.     "<<<",    /* TRINANG         */
  655.     "|",    /* BAR          25 */
  656.     "|&",    /* BARAMP         */
  657.     "()",    /* INOUTPAR         */
  658.     "((",    /* DINPAR         */
  659.     "))",    /* DOUTPAR         */
  660.     "&|",    /* AMPERBANG      30 */
  661. };
  662. #else
  663. extern char *tokstrings[];
  664. #endif
  665.  
  666. #ifdef GLOBALS
  667. char *cmdnames[] =
  668. {
  669.     "for",      "while",     "repeat",    "select",
  670.     "until",    "if",        "then",      "else",
  671.     "elif",     "math",      "cond",      "cmdor",
  672.     "cmdand",   "pipe",      "errpipe",   "foreach",
  673.     "case",     "function",  "subsh",     "cursh",
  674.     "array",    "quote",     "dquote",    "bquote",
  675.     "cmdsubst", "mathsubst", "elif-then", "heredoc",
  676.     "heredocd", "brace",     "braceparam",
  677. };
  678. #else
  679. extern char *cmdnames[];
  680. #endif
  681.  
  682. #ifndef GLOBALS
  683. extern struct option optns[OPT_SIZE];
  684. #else
  685. struct option optns[OPT_SIZE] = {
  686. # define x OPT_REV|
  687.     {NULL, 0, 0, 0},
  688.     {"allexport",         'a',  'a',  0},
  689.     {"alwayslastprompt",     0,    0,    0},
  690.     {"alwaystoend",         0,    0,    0},
  691.     {"appendhistory",         0,    0,    0},
  692.     {"autocd",             'J',  0,    0},
  693.     {"autolist",         '9',  0,    0},
  694.     {"automenu",         0,    0,    0},
  695.     {"autonamedirs",         0,    0,    0},
  696.     {"autoparamkeys",         0,    0,    0},
  697.     {"autoparamslash",         0,    0,    OPT_CSH},
  698.     {"autopushd",         'N',  0,    0},
  699.     {"autoremoveslash",     0,    0,    0},
  700.     {"autoresume",         'W',  0,    0},
  701.     {"badpattern",         x'2', 0,    OPT_EMULATE|OPT_NONBOURNE},
  702.     {"banghist",         x'K', 0,    OPT_EMULATE|OPT_NONBOURNE},
  703.     {"beep",             x'B', 0,    OPT_ALL},
  704.     {"bgnice",             '6',  0,    OPT_EMULATE|OPT_NONBOURNE},
  705.     {"braceccl",         0,    0,    0},
  706.     {"bsdecho",         0,    0,    OPT_EMULATE|OPT_SH},
  707.     {"cdablevars",         'T',  0,    0},
  708.     {"chaselinks",         'w',  0,    0},
  709.     {"clobber",         x'C', x'C', OPT_ALL},
  710.     {"completealiases",     0,    0,    0},
  711.     {"completeinword",         0,    0,    0},
  712.     {"correct",         '0',  0,    0},
  713.     {"correctall",         'O',  0,    0},
  714.     {"cshjunkiehistory",     0,    0,    OPT_EMULATE|OPT_CSH},
  715.     {"cshjunkieloops",         0,    0,    OPT_EMULATE|OPT_CSH},
  716.     {"cshjunkiequotes",     0,    0,    OPT_EMULATE|OPT_CSH},
  717.     {"cshnullglob",         0,    0,    OPT_EMULATE|OPT_CSH},
  718.     {"equals",             0,    0,    OPT_EMULATE|OPT_ZSH},
  719.     {"errexit",         'e',  'e',  0},
  720.     {"exec",             x'n', x'n', OPT_ALL},
  721.     {"extendedglob",         0,    0,    0},
  722.     {"extendedhistory",     0,    0,    OPT_EMULATE|OPT_CSH},
  723.     {"flowcontrol",         0,    0,    OPT_ALL},
  724.     {"functionargzero",        0,    0,    OPT_EMULATE|OPT_NONBOURNE},
  725.     {"glob",             x'F', x'f', OPT_ALL},
  726.     {"globassign",         0,    0,    OPT_EMULATE|OPT_CSH},
  727.     {"globcomplete",         0,    0,    0},
  728.     {"globdots",         '4',  0,    0},
  729.     {"globsubst",         0,    0,    OPT_EMULATE|OPT_NONZSH},
  730.     {"hashcmds",         0,    0,    OPT_ALL},
  731.     {"hashdirs",         0,    0,    OPT_ALL},
  732.     {"hashlistall",         0,    0,    OPT_ALL},
  733.     {"histallowclobber",     0,    0,    0},
  734.     {"histbeep",         0,    0,    OPT_ALL},
  735.     {"histignoredups",         'h',  0,    0},
  736.     {"histignorespace",     'g',  0,    0},
  737.     {"histnostore",         0,    0,    0},
  738.     {"histverify",         0,    0,    0},
  739.     {"hup",             0,    0,    OPT_EMULATE|OPT_ZSH},
  740.     {"ignorebraces",         'I',  0,    OPT_EMULATE|OPT_SH},
  741.     {"ignoreeof",         '7',  0,    0},
  742.     {"interactive",         'i',  'i',  OPT_SPECIAL},
  743.     {"interactivecomments",     'k',  0,    OPT_EMULATE|OPT_BOURNE},
  744.     {"ksharrays",         0,    0,    OPT_EMULATE|OPT_BOURNE},
  745.     {"kshoptionprint",         0,    0,    OPT_EMULATE|OPT_KSH},
  746.     {"listambiguous",         0,    0,    0},
  747.     {"listbeep",         0,    0,    OPT_ALL},
  748.     {"listtypes",         'X',  0,    OPT_CSH},
  749.     {"localoptions",         0,    0,    OPT_EMULATE|OPT_KSH},
  750.     {"login",             'l',  'l',  OPT_SPECIAL},
  751.     {"longlistjobs",         'R',  0,    0},
  752.     {"magicequalsubst",     0,    0,    0},
  753.     {"mailwarning",         'U',  0,    0},
  754.     {"markdirs",         '8',  'X',  0},
  755.     {"menucomplete",         'Y',  0,    0},
  756.     {"monitor",         'm',  'm',  OPT_SPECIAL},
  757.     {"multios",         0,    0,    OPT_EMULATE|OPT_ZSH},
  758.     {"nomatch",         x'3', 0,    OPT_EMULATE|OPT_NONBOURNE},
  759.     {"notify",             '5',  'b',  OPT_ZSH},
  760.     {"nullglob",         'G',  0,    OPT_EMULATE},
  761.     {"numericglobsort",     0,    0,    0},
  762.     {"overstrike",         0,    0,    0},
  763.     {"pathdirs",         'Q',  0,    0},
  764.     {"posixbuiltins",        0,    0,    OPT_EMULATE|OPT_BOURNE},
  765.     {"printexitvalue",         '1',  0,    0},
  766.     {"privileged",         'p',  'p',  OPT_SPECIAL},
  767.     {"promptcr",         x'V', 0,    OPT_ALL},
  768.     {"promptsubst",         0,    0,    OPT_EMULATE|OPT_KSH},
  769.     {"pushdignoredups",     0,    0,    0},
  770.     {"pushdminus",         0,    0,    0},
  771.     {"pushdsilent",         'E',  0,    0},
  772.     {"pushdtohome",         'D',  0,    0},
  773.     {"rcexpandparam",         'P',  0,    0},
  774.     {"rcquotes",         0,    0,    0},
  775.     {"rcs",             x'f', 0,    OPT_ALL},
  776.     {"recexact",         'S',  0,    0},
  777.     {"rmstarsilent",         'H',  0,    OPT_BOURNE},
  778.     {"shfileexpansion",        0,    0,    OPT_EMULATE|OPT_BOURNE},
  779.     {"shglob",             0,    0,    OPT_EMULATE|OPT_BOURNE},
  780.     {"shinstdin",         's',  's',  OPT_SPECIAL},
  781.     {"shoptionletters",        0,    0,    OPT_EMULATE|OPT_BOURNE},
  782.     {"shortloops",         0,    0,    OPT_ALL},
  783.     {"shwordsplit",         'y',  0,    OPT_EMULATE|OPT_BOURNE},
  784.     {"singlecommand",        't',  't',  OPT_SPECIAL},
  785.     {"singlelinezle",         'M',  0,    OPT_KSH},
  786.     {"sunkeyboardhack",     'L',  0,    0},
  787.     {"unset",             x'u', x'u', OPT_EMULATE|OPT_BSHELL},
  788.     {"verbose",         'v',  'v',  0},
  789.     {"xtrace",             'x',  'x',  0},
  790.     {"zle",             'Z',  0,    OPT_SPECIAL},
  791. };
  792. # undef x
  793. #endif
  794.  
  795. EXTERN short int typtab[256];
  796.