home *** CD-ROM | disk | FTP | other *** search
- From: pjc@pcbox.UUCP (Paul J. Condie)
- Newsgroups: alt.sources
- Subject: menu(1) part 6 of 11
- Message-ID: <428@pcbox.UUCP>
- Date: 6 Apr 90 17:53:04 GMT
-
-
- #!/bin/sh
- # this is part 6 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file runscreen.c continued
- #
- CurArch=6
- if test ! -r s2_seq_.tmp
- then echo "Please unpack part 1 first!"
- exit 1; fi
- ( read Scheck
- if test "$Scheck" != $CurArch
- then echo "Please unpack part $Scheck next!"
- exit 1;
- else exit 0; fi
- ) < s2_seq_.tmp || exit 1
- echo "x - Continuing file runscreen.c"
- sed 's/^X//' << 'SHAR_EOF' >> runscreen.c
- X char screen_name[];
- X struct MenuInfo *menu;
- X int opnumber;
- X{
- X FILE *popen(), *pp;
- X char *getenv();
- X char *getval();
- X char *findfile();
- X WINDOW *swin;
- X union FldUnion Fld;
- X int rc; /* return code */
- X int exitkey;
- X int sidx;
- X int fidx = 0;
- X char fieldinput[MAXFIELDS+1][100];
- X int fieldcount;
- X char *promptptr;
- X char *mask; /* mask pointer */
- X char fmtdefault[100];/* formated default value */
- X char *wsptr; /* working storage pointer */
- X char *source; /* default data pointer */
- X int helpflag = TRUE;
- X char helpfile[80];
- X char tmptitle[100];
- X int toprow;
- X int leftcol;
- X
- X
- X
- X /* Find the screen definition */
- X for (sidx = 0; menu->srn[sidx] != (struct ScreenInfo *)NULL &&
- X sidx <= MAXSCREENS; sidx++)
- X {
- X if (strcmp (screen_name, menu->srn[sidx]->name) == 0)
- X break;
- X }
- X if (sidx > MAXSCREENS || menu->srn[sidx] == (struct ScreenInfo *)NULL)
- X {
- X BEEP;
- X mvprintw (ErrRow-2,0, "Could not find your screen definition.");
- X shutdown ();
- X }
- X
- X wsptr = SRN->toprowvar;
- X if (strcmp (SRN->toprowvar, "") != 0)
- X toprow = atoi (getval (&wsptr, '1'));
- X else
- X toprow = SRN->toprow;
- X wsptr = SRN->leftcolvar;
- X if (strcmp (SRN->leftcolvar, "") != 0)
- X leftcol = atoi (getval (&wsptr, '1'));
- X else
- X leftcol = SRN->leftcol;
- X
- X if (toprow == AUTO)
- X {
- X /*
- X ** Figure out where to put the screen
- X ** try to put screen as close to the option as possible
- X */
- X toprow = menu->option[opnumber]->row - 2;
- X /*
- X for (rc = 0, leftcol = 0; rc < menu->optioncount ; rc ++)
- X if (strlen (menu->option[rc]->description) > leftcol)
- X leftcol = strlen (menu->option[rc]->description);
- X leftcol = menu->option[opnumber]->col +
- X ((leftcol + 4) / 2);
- X */
- X leftcol = menu->option[opnumber]->col +
- X strlen(menu->option[opnumber]->description) + 4;
- X
- X /* make sure it fits on the screen */
- X if ((toprow + SRN->rows) > LINES-1)
- X toprow = LINES - SRN->rows - 1;
- X
- X if ((leftcol + SRN->cols + 2) > COLS)
- X leftcol = COLS - SRN->cols - 1;
- X }
- X
- X
- X /* create the window */
- X swin = newwin (SRN->rows, SRN->cols, toprow, leftcol);
- X keypad (swin, TRUE);
- X
- X /*
- X ** check if recalculation of rows & cols is necessary
- X ** see newwin() for info on why
- X */
- X if (SRN->rows == 0 && SRN->cols == 0 &&
- X toprow == 0 && leftcol == 0)
- X {
- X /* a full-screen was created */
- X SRN->rows = LINES-1;
- X SRN->cols = COLS;
- X }
- X else if (SRN->rows == 0 || SRN->cols == 0)
- X {
- X SRN->rows = LINES - toprow;
- X SRN->cols = COLS - leftcol;
- X if (SRN->rows == LINES)
- X SRN->rows--;
- X }
- X
- X
- X if (strcmp (SRN->helpfile, "") == 0)
- X helpflag = FALSE;
- X else
- X strcpy (helpfile, findfile (SRN->helpfile, ".",
- X getenv("HELPDIR"), getenv("MENUDIR"), ""));
- X drawbox (swin, 1,1, SRN->rows,SRN->cols, SRN->boxtype & 0777,
- X StandoutLine, FALSE, helpflag);
- X
- X /* display title */
- X wsptr = SRN->title;
- X strcpy (tmptitle, getval (&wsptr, '1'));
- X wattrset (swin, A_STANDOUT);
- X mvwprintw (swin, 0, ((SRN->cols)/2)-(strlen(tmptitle)/2),
- X "%s", tmptitle);
- X /*
- X if (strcmp (menu->helpfile, "") != 0)
- X mvwprintw (menu->win, menu->NumItems+2,menu->width+3, "?");
- X */
- X wattrset (swin, A_NORMAL);
- X
- X /*
- X ** Run fielddefaults if there is one and load results into fieldinput
- X */
- X if (SRN->fielddefaults != (char *)NULL)
- X {
- X if (debug)
- X {
- X fprintf (stderr, "\n[runscreen] <%s> popen=:%s:",
- X SRN->name, SRN->fielddefaults);
- X fflush (stderr);
- X }
- X move (ErrRow,0); clrtoeol();
- X mvprintw (ErrRow,1, "Initializing screen fields...");
- X refresh ();
- X if ((pp = popen (SRN->fielddefaults, "r")) == (FILE *)NULL)
- X {
- X BEEP;
- X mvprintw (ErrRow-2,0, "Could not open pipe = %s",
- X SRN->fielddefaults);
- X shutdown ();
- X }
- X
- X /* read and set each field until no more input */
- X rc = 99;
- X for (fidx = 0; SRN->field[fidx] != (struct FieldInfo *)NULL &&
- X fidx <= MAXFIELDS; fidx++)
- X {
- X strcpy (fieldinput[fidx], "");
- X if (rc == EOF)
- X {
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[runscreen] <%s> read nothing from popen",
- X SRN->name);
- X fprintf (stderr,
- X "\n[runscreen] <%s> field %d =:%s:",
- X SRN->name,fidx, fieldinput[fidx]);
- X fflush (stderr);
- X }
- X continue;
- X }
- X
- X /* get a word from the pipe */
- X rc = fscanf (pp, "%s", fmtdefault);
- X if (rc == EOF) continue;
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[runscreen] <%s> read from popen=:%s:",
- X SRN->name, fmtdefault);
- X fflush (stderr);
- X }
- X
- X /* check for NULL value */
- X if (strcmp (fmtdefault, "NULL") == 0)
- X {
- X strcpy (fieldinput[fidx], "");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[runscreen] <%s> field %d =:%s:",
- X SRN->name,fidx, fieldinput[fidx]);
- X fflush (stderr);
- X }
- X continue;
- X }
- X
- X /* check for a quoted value */
- X if (fmtdefault[0] == '"')
- X {
- X /*
- X ** found a quoted value
- X ** read until another quote or end of line
- X */
- X strcpy (fieldinput[fidx], fmtdefault+1);
- X if (fmtdefault[strlen(fmtdefault)-1] == '"')
- X {
- X /* end of quote is on first word */
- X fieldinput[fidx][strlen(fieldinput[fidx])-1] = '\0';
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[runscreen] <%s> field %d =:%s:",
- X SRN->name, fidx,
- X fieldinput[fidx]);
- X fflush (stderr);
- X }
- X continue;
- X }
- X while ((rc = fscanf (pp, "%s", fmtdefault)) != EOF)
- X {
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[runscreen] <%s> read from popen=:%s:",
- X SRN->name, fmtdefault);
- X fflush (stderr);
- X }
- X strcat (fieldinput[fidx], " ");
- X strcat (fieldinput[fidx], fmtdefault);
- X if (fmtdefault[strlen(fmtdefault)-1] == '"')
- X {
- X /* end of quote */
- X fieldinput[fidx][strlen(fieldinput[fidx])-1] = '\0';
- X break;
- X }
- X }
- X }
- X else
- X strcpy (fieldinput[fidx], fmtdefault);
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[runscreen] <%s> field %d =:%s:",
- X SRN->name, fidx, fieldinput[fidx]);
- X fflush (stderr);
- X }
- X } /* end for each field */
- X pclose(pp);
- X }
- X
- X /*
- X ** Initialize the screen
- X ** Loop through each field
- X ** print the label
- X ** for SET and MENU types determine field_length
- X ** put in the field terminators
- X ** get, format and print default value in getenv () or fielddefaults
- X */
- X for (fidx = 0; SRN->field[fidx] != (struct FieldInfo *)NULL &&
- X fidx <= MAXFIELDS;
- X fidx++)
- X {
- X /* print label */
- X if (strlen(FLD->label) > 0)
- X mvwprintw (swin, FLD->row,
- X FLD->col - strlen(FLD->label) - 2,
- X "%s", FLD->label);
- X
- X /* for SET and MENU types get field_length */
- X if (FLD->type == SET || FLD->type == MENU)
- X FLD->length = GetSetLen (FLD->range);
- X
- X /* print field terminators */
- X if (strlen(FLD->terminator) > 0)
- X {
- X /* left */
- X mvwprintw (swin, FLD->row, FLD->col - 1,
- X "%c", FLD->terminator[0]);
- X /* right */
- X if (strlen(FLD->mask) > 0)
- X mvwprintw (swin, FLD->row,
- X FLD->col + strlen(FLD->mask),
- X "%c", FLD->terminator[1]);
- X else
- X mvwprintw (swin, FLD->row,
- X FLD->col + FLD->length,
- X "%c", FLD->terminator[1]);
- X }
- X
- X /*
- X ** If a fielddefaults command was given
- X ** then the default values are already in fieldinput
- X ** else load from getenv()
- X */
- X if (SRN->fielddefaults == (char *)NULL)
- X {
- X /* get default value from getenv() */
- X if (getenv(FLD->name) != (char *)NULL)
- X strcpy (fieldinput[fidx], getenv (FLD->name));
- X else
- X strcpy (fieldinput[fidx], "");
- X if (strcmp (fieldinput[fidx], "NULL") == 0)
- X strcpy (fieldinput[fidx], "");
- X }
- X
- X /* format default value to the mask */
- X strcpy (fmtdefault, fieldinput[fidx]);
- X if (strlen(FLD->mask) > 0)
- X {
- X wsptr = fmtdefault;
- X mask = FLD->mask;
- X source = fieldinput[fidx];
- X for (; *mask != '\0'; mask++, wsptr++)
- X {
- X if (IsMask (FLD->type, *mask))
- X *wsptr = *mask; /* format char */
- X else
- X {
- X if (*source != '\0')
- X {
- X *wsptr = *source;
- X source++;
- X }
- X else
- X *wsptr = ' '; /* no data */
- X }
- X }
- X *wsptr = '\0';
- X }
- X /* print default data */
- X if (strlen(fmtdefault) > 0)
- X mvwprintw (swin, FLD->row, FLD->col, "%s", fmtdefault);
- X }
- X fieldcount = fidx-1; /* save field count */
- X
- X
- X /*
- X ** GetInput from fields untill KEY_CANCEL || KEY_ACCEPT
- X */
- X move (ErrRow,0); clrtoeol();
- X fidx = 0; /* start with first field */
- X
- X do
- X {
- X Fld.strVal = fieldinput[fidx];
- X
- X
- X if (exitkey == 999)
- X /*
- X ** This is so GetInput doesn't overwrite the
- X ** must enter message.
- X */
- X promptptr = NOMSG;
- X else
- X promptptr = FLD->prompt;
- X
- X /* if noinput == FALSE prompt for input */
- X if (!FLD->noinput)
- X {
- X exitkey = GetInput (swin, FLD->row, FLD->col, &Fld,
- X A_REVERSE, FLD->mask, FLD->range, FLD->length,
- X FLD->min_input, FLD->type, FLD->adjust, CHAR,
- X NOAUTO, FLD->mustenter, ErrRow, ErrRow,
- X promptptr, helpfile, FLD->name);
- X }
- X else
- X {
- X /* use the exitkey from the last field */
- X if (exitkey != KEY_UP)
- X exitkey = KEY_DOWN;
- X }
- X
- X
- X if (exitkey == KeyReturn) exitkey = KEY_RETURN;
- X if (exitkey == KeyUp) exitkey = KEY_UP;
- X if (exitkey == KeyDown) exitkey = KEY_DOWN;
- X if (exitkey == KeyTab) exitkey = KEY_TAB;
- X if (exitkey == KeyBTab) exitkey = KEY_BTAB;
- X if (exitkey == KeyCancel) exitkey = KEY_CANCEL;
- X if (exitkey == KeyAccept) exitkey = KEY_ACCEPT;
- X
- X /* if exitlastfield accept input and exit on last field */
- X if (SRN->exitlastfield && fidx == fieldcount &&
- X exitkey == KEY_RETURN)
- X exitkey = KEY_ACCEPT;
- X
- X switch (exitkey)
- X {
- X case KEY_CANCEL:
- X break;
- X
- X case KEY_ACCEPT:
- X /* make sure mustenter fields have been entered */
- X for (fidx = 0; fidx <= fieldcount; fidx++)
- X if (FLD->mustenter &&
- X strcmp (fieldinput[fidx], "") == 0)
- X {
- X mvwprintw (stdscr, ErrRow,1,
- X "This is a must enter field.");
- X BEEP;
- X wnoutrefresh (stdscr);
- X exitkey = 999;
- X break;
- X }
- X /* if mustenter then more input */
- X if (fidx <= fieldcount)
- X break;
- X
- X /* set the environment variables */
- X for (fidx = 0; fidx <= fieldcount; fidx++)
- X {
- X if (strcmp (fieldinput[fidx], "") == 0)
- X strcpy (fieldinput[fidx], "NULL");
- X
- X rc = setenv (FLD->name, fieldinput[fidx]);
- X if (rc < 0)
- X {
- X mvwprintw (stdscr, ErrRow,0, "Unable to allocate environment memory to set variable %s.", fieldinput[fidx]);
- X BEEP;
- X }
- X }
- X break;
- X
- X case KEY_TAB:
- X fidx += 4;
- X fidx = fidx >= fieldcount ? 0 : ++fidx;
- X break;
- X
- X case KEY_BTAB:
- X fidx -= 4;
- X fidx = fidx < 0 ? fieldcount : --fidx;
- X break;
- X
- X case KEY_UP:
- X fidx = fidx <= 0 ? fieldcount : --fidx;
- X break;
- X
- X case KEY_RETURN:
- X case KEY_DOWN:
- X default:
- X fidx = fidx >= fieldcount ? 0 : ++fidx;
- X break;
- X }
- X } while (exitkey != KEY_CANCEL && exitkey != KEY_ACCEPT);
- X
- X delwin (swin); /* junk screen window */
- X wmove (stdscr,LINES-1,0);
- X clrtoeol (); /* clear field prompt */
- X touchwin (stdscr);
- X
- X if (exitkey == KEY_CANCEL)
- X return (exitkey);
- X else
- X return (0);
- X}
- X/* Paul J. Condie 11/88 */
- SHAR_EOF
- echo "File runscreen.c is complete"
- chmod 0644 runscreen.c || echo "restore of runscreen.c fails"
- echo "x - extracting getval.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > getval.c &&
- X#ifndef LINT
- Xstatic char Sccsid[] = "%W% DeltaDate %G% ExtrDate %H%";
- X#endif
- X
- X/*
- X** getval()
- X** ARGS:
- X** sptr - pointer to beginning of value 2b parsed
- X** endch - $ process only the dollar part of value
- X** - ` process only the single quote part of value
- X** - " process only the double quote part of value
- X** - 0 process until a space or invalid is found
- X** - 1 process entire string until '\0' is found
- X** RETURNS:
- X** sptr - pointer to end of value 2b parsed
- X** rval - the resulting value.
- X**
- X** var=one
- X** var="one"
- X** var=$var
- X** var="one $var"
- X** var=${var}
- X** var=`ls`
- X** var=one"two three"
- X** var=~/
- X** var=~usr/
- X*/
- X
- X#include <stdio.h>
- X#include <ctype.h>
- X#include <pwd.h>
- X
- X#define DQUOTE '"'
- X#define SQUOTE '`'
- X#define LITERAL '\''
- X#define DOLLAR '$'
- X#define ESCAPE '\\'
- X#define BRACE '{'
- X#define COMCHAR '#'
- X#define TILDE '~'
- X#ifndef TRUE
- X#define TRUE 1
- X#define FALSE 0
- X#endif
- X
- X#ifndef TEST
- Xextern int debug;
- X#endif
- X
- X
- Xchar *getval (sptr, endch)
- X char **sptr; /* pointer to $+1 */
- X char endch;
- X{
- X char *getenv();
- X struct passwd *getpwnam();
- X FILE *popen(), *pp;
- X static char value[400];
- X char tmpval[400];
- X static char *rval; /* pointer for return */
- X int i;
- X int EOV = FALSE; /* End Of Value */
- X int dqflag = FALSE; /* double quote flag */
- X struct passwd *pw;
- X
- X
- X strcpy (value, "");
- X rval = value;
- X while (!EOV && **sptr)
- X {
- X switch (**sptr)
- X {
- X case SQUOTE:
- X (*sptr)++; /* get past ' */
- X for (i = 0; **sptr != '`' && **sptr; i++, (*sptr)++)
- X tmpval[i] = **sptr;
- X if (**sptr)
- X (*sptr)++; /* get past ' */
- X tmpval[i] = '\0';
- X /* open pipe and read results */
- X if ((pp = popen (tmpval, "r")) != NULL)
- X {
- X for (; ((i = fgetc(pp)) != EOF); rval++)
- X {
- X *rval = i ;
- X if (!isprint(*rval))
- X rval--;
- X }
- X pclose (pp);
- X }
- X if (endch == SQUOTE)
- X {
- X *rval = '\0';
- X rval = value;
- X return (rval);
- X }
- X break;
- X
- X case DQUOTE:
- X (*sptr)++;
- X dqflag = dqflag == FALSE ? TRUE : FALSE;
- X if (endch == DQUOTE && dqflag == FALSE)
- X {
- X *rval = '\0';
- X rval = value;
- X return (rval);
- X }
- X break;
- X
- X case DOLLAR:
- X /* Substitutable parameter */
- X
- X (*sptr)++; /* get past $ */
- X
- X /*
- X ** The braces are required only when parameter is
- X ** followed by a letter, digit, or underscore.
- X */
- X if (**sptr == BRACE)
- X {
- X (*sptr)++; /* get past { */
- X for (i = 0; **sptr != '}' && **sptr;
- X i++, (*sptr)++)
- X tmpval[i] = **sptr;
- X if (**sptr)
- X (*sptr)++; /* get past } */
- X }
- X else
- X {
- X for (i = 0; isalnum(**sptr) || **sptr == '_';
- X i++, (*sptr)++)
- X tmpval[i] = **sptr;
- X }
- X tmpval[i] = '\0';
- X if (getenv(tmpval) != (char *)NULL)
- X strcpy (rval, getenv(tmpval));
- X rval += strlen (rval);
- X if (endch == DOLLAR)
- X {
- X *rval = '\0';
- X rval = value;
- X return (rval);
- X }
- X break;
- X
- X case TILDE:
- X (*sptr)++; /* get past ~ */
- X /*
- X ** ~/ = $HOME
- X ** ~user/ = home(user)
- X */
- X for (i = 0; **sptr != '/' && **sptr; i++, (*sptr)++)
- X tmpval[i] = **sptr;
- X tmpval[i] = '\0';
- X if (strcmp (tmpval, "") == 0)
- X if (getenv("LOGNAME") != (char *)NULL)
- X strcpy (tmpval, getenv ("LOGNAME"));
- X /*
- X ** tmpval holds the user name
- X ** now we get the password entry
- X */
- X pw = getpwnam (tmpval);
- X strcpy (rval, pw->pw_dir);
- X rval += strlen (pw->pw_dir);
- X break;
- X
- X default:
- X if (dqflag || **sptr != ' ' || endch == '1')
- X {
- X *rval++ = **sptr;
- X (*sptr)++;
- X }
- X else
- X EOV = TRUE;
- X break;
- X } /* end switch */
- X } /* end while */
- X
- X *rval = '\0';
- X rval = value;
- X#ifndef TEST
- X if (debug)
- X {
- X fprintf (stderr, "\n[%s] value=:%s:, :%s:",
- X __FILE__, value, *sptr);
- X fflush (stderr);
- X }
- X#endif
- X return (rval);
- X}
- X
- X
- X
- X#ifdef TEST
- Xmain (argc, argv)
- X int argc;
- X char *argv[];
- X{
- X char *getval();
- X char *sptr;
- X char *rval;
- X
- X sptr = argv[1];
- X if (argc == 3)
- X rval = getval (&sptr, argv[2][0]);
- X else
- X rval = getval (&sptr, '1');
- X printf ("\nparameter value :%s:", rval);
- X printf ("\narg pointer :%s:", sptr);
- X}
- X#endif
- X/* Paul J. Condie 5/89 */
- SHAR_EOF
- chmod 0644 getval.c || echo "restore of getval.c fails"
- echo "x - extracting clean_menu.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > clean_menu.c &&
- X#ifndef LINT
- Xstatic char Sccsid[] = "@(#)clean_menu.c 1.1 DeltaDate 6/14/89 ExtrDate 1/22/90";
- X#endif
- X
- X#include "menu.h"
- X
- Xclean_menu (menu)
- X struct MenuInfo *menu;
- X{
- X int i,j;
- X
- X
- X /*
- X ** Just to keep things simple, lets start from scratch on the
- X ** next menu selected.
- X */
- X
- X /* free options */
- X for (i = 0; i < menu->optioncount; i++)
- X free (menu->option[i]);
- X
- X /* free screens */
- X for (i = 0; menu->srn[i] != (struct ScreenInfo *)NULL &&
- X i <= MAXSCREENS; i++)
- X {
- X if (menu->srn[i]->fielddefaults != (char *)NULL)
- X free (menu->srn[i]->fielddefaults);
- X /* free screen fields */
- X for (j = 0;
- X menu->srn[i]->field[j] != (struct FieldInfo *)NULL &&
- X j <= MAXFIELDS; j++)
- X free (menu->srn[i]->field[j]);
- X free (menu->srn[i]);
- X menu->srn[i] = (struct ScreenInfo *)NULL;
- X }
- X}
- X/* Paul J. Condie 6/89 */
- SHAR_EOF
- chmod 0444 clean_menu.c || echo "restore of clean_menu.c fails"
- echo "x - extracting System.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > System.c &&
- X#ifndef LINT
- Xstatic char Sccsid[] = "@(#)System.c 1.1 DeltaDate 1/22/90 ExtrDate 1/22/90";
- X#endif
- X
- X/*
- X** System()
- X** Reset the effective uid/gid in case menu has the set uid bit set.
- X*/
- X
- XSystem( cmdStr )
- X char *cmdStr ;
- X{
- X register int uid, euid, gid, egid ;
- X
- X /* who am i */
- X uid = getuid() ;
- X euid = geteuid() ;
- X gid = getgid() ;
- X egid = getegid() ;
- X
- X /* reset back to the read id */
- X setuid( uid ) ;
- X setgid( gid ) ;
- X
- X system( cmdStr ) ;
- X
- X /* reset back to the fake id */
- X setuid( euid ) ;
- X setgid( egid ) ;
- X}
- X/* Sam S. Lok 11/89 */
- SHAR_EOF
- chmod 0444 System.c || echo "restore of System.c fails"
- echo "x - extracting slength.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > slength.c &&
- X#ifndef LINT
- Xstatic char Sccsid[] = "@(#)slength.c 1.1 DeltaDate 1/22/90 ExtrDate 1/22/90";
- X#endif
- X
- X/*
- X** How long is a string not counting attributes.
- X*/
- X
- Xslength (s)
- X char *s;
- X{
- X register int i = 0;
- X
- X while (*s)
- X {
- X if (*s == '\\')
- X {
- X s++;
- X s++;
- X continue;
- X }
- X s++;
- X i++;
- X }
- X return (i);
- X}
- X/* Paul J. Condie 11-89 */
- SHAR_EOF
- chmod 0444 slength.c || echo "restore of slength.c fails"
- echo "x - extracting upper.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > upper.c &&
- X#ifndef LINT
- Xstatic char Sccsid[] = "@(#)upper.c 1.1 DeltaDate 1/22/90 ExtrDate 1/22/90";
- X#endif
- X
- Xupper (s)
- X
- X char *s;
- X{
- X register int i;
- X
- X while (*s)
- X {
- X if (*s >= 'a' && *s <= 'z')
- X *s = (*s + 'A' - 'a');
- X s++;
- X }
- X}
- SHAR_EOF
- chmod 0444 upper.c || echo "restore of upper.c fails"
- echo "x - extracting substr.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > substr.c &&
- X/* E911 Project
- X * substr()
- X *
- X * Purpose: To find a substring within a given string
- X * Args: s1: The string being searched
- X * s2: the string being searched for
- X * Return: pointer to the where the searched for string resides
- X * within the search string; otherwise NULL
- X */
- X
- X
- Xchar *
- Xsubstr(s1, s2)
- Xchar *s1;
- Xchar *s2;
- X{
- X char *p1, *p2;
- X
- X for ( ; *s1; s1++) {
- X if (*s1 != *s2)
- X continue;
- X p1 = s1 + 1;
- X p2 = s2 + 1;
- X while (1) {
- X if (*p2 == '\0')
- X return(s1);
- X if (*p1++ != *p2++)
- X break;
- X }
- X }
- X return(0);
- X}
- X
- X
- X#ifdef LTEST
- Xmain()
- X{
- X char *strtok();
- X
- X char *s1, *s2, *s3;
- X char buffer[256];
- X
- X printf("ok\n");
- X while (gets(buffer)) {
- X s1 = strtok(buffer, " \t:\n");
- X s2 = strtok(0, " \t:\n");
- X printf("%s:%s:", s1, s2);
- X if (s1 && s2)
- X if (s3 = substr(s1, s2))
- X printf("%.*s\n", strlen(s2), s3);
- X else
- X printf("no match\n");
- X else
- X printf("invalid input\n");
- X }
- X}
- X#endif
- X
- X
- SHAR_EOF
- chmod 0666 substr.c || echo "restore of substr.c fails"
- echo "x - extracting menu.h (Text)"
- sed 's/^X//' << 'SHAR_EOF' > menu.h &&
- X#ifndef LINT
- Xstatic char ID_menu[] = "%W% DeltaDate %G% ExtrDate %H%";
- X#endif
- X
- X#define VERSION "3.41" /* current version */
- X
- X#ifndef BELL
- X#define BELL printf ("%c", 7)
- X#endif
- X#ifndef BEEP
- X#define BEEP printf ("%c", 7)
- X#endif
- X#ifndef NULL
- X#define NULL 0
- X#endif
- X#define null 0
- X#define MENUINIT ".menuinit" /* initialize filename */
- X#define HELPFILE "menu.hlp"
- X#define BORDERCHAR ' '
- X#define MAXTITLE 6 /* maximum # of title lines */
- X#define MAXKEYS 25 /* maximum # of keys */
- X#define MAXKEYLENGTH 15 /* maximum length of keyword */
- X#define MAXOPTION 60 /* max # of option 2b displayed */
- X#define MAXMENU 20 /* max nested menus */
- X#define MAXGNAME 20 /* max goto menu names */
- X#define MAXLEN 1024 /* max length of option command */
- X#define MAXSCREENS 10 /* max .DEFINE_SCREEN per menu */
- X#define MAXFIELDS 20 /* max fields per .DEFINE_SCREEN */
- X#define ErrRow (LINES-1) /* last line to print error message */
- X#define GNAMEOFFSET 100 /* Offset return code for gnames */
- X
- X#define QUIT -1
- X#define MAINMENU -2
- X#define PREVIOUSMENU -3
- X#define NOWAYJOSE -4 /* not authorized for menu */
- X#define REPARSE -5 /* reparse & display the current menu */
- X#define SUBMENU -99 /* a submenu was selected */
- X
- X#define BUFSIZE 512
- X
- X/* Line drawing types */
- X#define DumbLine 1
- X#define StandoutLine 2
- X#define SingleLine 3
- X#define MosaicLine 4
- X#define DiamondLine 5
- X#define DotLine 6
- X#define PlusLine 7
- X
- X#define AUTO 999
- X
- X
- X/*
- X** Keys not defined in some curses.h
- X*/
- X
- X#ifndef KEY_HELP
- X# define KEY_HELP 0553
- X#endif
- X#ifndef KEY_REFRESH
- X# define KEY_REFRESH 0565
- X#endif
- X#ifndef KEY_CANCEL
- X# define KEY_CANCEL 0543
- X#endif
- X#ifndef KEY_TAB
- X# define KEY_TAB '\t'
- X#endif
- X#ifndef KEY_BTAB
- X# define KEY_BTAB 0541
- X#endif
- X#ifndef KEY_RETURN
- X# define KEY_RETURN '\r'
- X#endif
- X#ifndef KEY_LINEFEED
- X# define KEY_LINEFEED '\n'
- X#endif
- X#ifndef KEY_REFRESH
- X# define KEY_REFRESH 0565
- X#endif
- X#ifndef KEY_BEG
- X# define KEY_BEG 0542
- X#endif
- X#ifndef KEY_END
- X# define KEY_END 0550
- X#endif
- X#define KEY_ACCEPT 1000
- X#define KEY_MAINMENU 1001
- X#define KEY_PREVMENU 1002
- X#define KEY_EXITMENU 1003
- X#define KEY_POPGNAME 1004
- X#define KEY_GNAME 1005
- X
- X/*
- X** MACROS
- X*/
- X
- X#define SKIPJUNK(s) /* \
- X ** This macro skips over spaces, tabs, etc. \
- X ** ARGS: char *s \
- X */ \
- X for (;*s != '\0' && (isspace(*s)); s++) \
- X ;
- X
- X
- X/*
- X** STRUCTURES
- X*/
- X
- Xstruct MenuInfo
- X{
- X char name [15]; /* file name */
- X int wfrow; /* window first row */
- X int wlrow; /* window last row */
- X int wfcol; /* window first col */
- X int wlcol; /* window last col */
- X int row_cursor; /* row for cursor */
- X int col_cursor; /* col for cursor */
- X unsigned boxtype; /* 0 = no box */
- X unsigned linetype; /* same as box */
- X int titlecount;
- X int optioncount; /* base 0 */
- X struct OptionInfo *option [MAXOPTION];
- X struct ScreenInfo *srn [MAXSCREENS+1]; /* .DEFINE_SCREEN */
- X /* NULL = EOL */
- X};
- X
- X
- Xstruct OptionInfo
- X{
- X char keyword [MAXKEYLENGTH+1];
- X int opnumber; /* option number */
- X char description [200];
- X char command [MAXLEN];
- X int row; /* row to display */
- X int col; /* col to display */
- X};
- X
- Xstruct ScreenInfo
- X{
- X char name [30]; /* screen name */
- X char title [100]; /* window title */
- X int toprow; /* upper left corner */
- X char toprowvar[40];
- X int leftcol;
- X char leftcolvar[40];
- X int rows; /* # rows in win */
- X int cols; /* # cols in win */
- X unsigned boxtype; /* 0 = no box */
- X int exitlastfield; /* after last field */
- X char helpfile[16];
- X char *fielddefaults; /* init field command */
- X struct FieldInfo *field [MAXFIELDS+1];
- X};
- X
- X
- Xstruct FieldInfo
- X{
- X char name [30]; /* field name */
- X char label [50]; /* field label */
- X int row; /* start position */
- X int col;
- X int length;
- X int min_input;
- X char mask [100];
- X char range [1025];
- X char type;
- X char adjust;
- X int mustenter;
- X char prompt [100];
- X char terminator[3]; /* field terminators */
- X int noinput;
- X};
- SHAR_EOF
- chmod 0644 menu.h || echo "restore of menu.h fails"
- echo "x - extracting terminal.h (Text)"
- sed 's/^X//' << 'SHAR_EOF' > terminal.h &&
- X#ifndef LINT
- Xstatic char ID_terminal[] = "@(#)terminal.h 1.7 DeltaDate 1/22/90 ExtrDate 1/22/90";
- X#endif
- X
- X/* Mover Keys */
- Xextern int KeyReturn;
- Xextern int KeyDown;
- Xextern int KeyUp;
- Xextern int KeyTab;
- Xextern int KeyBTab;
- X
- X/* Edit Keys */
- Xextern int KeyBeg;
- Xextern int KeyEnd;
- Xextern int KeyRight;
- Xextern int KeyLeft;
- Xextern int KeyBackspace;
- Xextern int KeyEOL;
- Xextern int KeyDL;
- Xextern int KeyDC;
- Xextern int KeyIC;
- X
- X/* Other Keys */
- Xextern int KeyHelp;
- Xextern int KeyRedraw;
- Xextern int KeyCancel;
- Xextern int KeySave;
- Xextern int KeyPrint;
- Xextern int KeyAccept;
- X
- X
- X/* Menu Specific Keys */
- Xextern int KeyMainMenu;
- Xextern int KeyPrevMenu;
- Xextern int KeyExitMenu;
- Xextern int KeyGname;
- Xextern int KeyPopGname;
- SHAR_EOF
- chmod 0444 terminal.h || echo "restore of terminal.h fails"
- echo "x - extracting LexDeSrn.l (Text)"
- sed 's/^X//' << 'SHAR_EOF' > LexDeSrn.l &&
- X%{
- X#ifndef LINT
- Xstatic char Sccsid[] = "%W% DeltaDate %G% ExtrDate %H%";
- X#endif
- X%}
- X
- X%{
- X#include "y.tab.h"
- X#include "menu.h"
- X
- X#undef YYLMAX
- X#define YYLMAX MAXLEN
- X
- Xchar *malloc();
- X%}
- X%%
- X%{
- X/*
- X** Operators:
- X** " \ [ ] ^ - ? . * + | ( ) $ / { } % < >
- X** - match a range
- X** ^ match all except or match begining of line if outside []
- X** . match any character except \n
- X** ? optional ab?c matches ac or abc
- X** | alternation ab|cd matches either ab or cd
- X** $ match end of line
- X** / trailing context ab/cd matches ab only if followed by cd
- X** <> start conditions
- X** {} repetitions a{1,5} or definition expansion {abc}
- X** % separator for source segments
- X**
- X** object match one occurence of object
- X** object* matches zero or more occurrences of object
- X** object+ matches one or more occurrences of object
- X** object{m,n} match m through n occurrences of object
- X*/
- X%}
- X
- X%{ /* Screen Stuff
- X%}
- X"window_rows" return (SCREEN_ROWS);
- X"window_title" return (SCREEN_TITLE);
- X"window_cols" return (SCREEN_COLS);
- X"window_border" return (SCREEN_BORDER);
- X"window_pos" return (SCREEN_POS);
- X"helpfile" return (SCREEN_HELP);
- X"exit_last_field" return (EXIT_LAST_FIELD);
- X
- X%{ /* Field Stuff
- X%}
- X"field_name" return(FIELD_NAME);
- X"field_label" return(FIELD_LABEL);
- X"field_row" return (FIELD_ROW);
- X"field_col" return (FIELD_COL);
- X"field_mask" return (FIELD_MASK);
- X"field_range" return (FIELD_RANGE);
- X"field_length" return (FIELD_LENGTH);
- X"field_min" return (FIELD_MIN);
- X"field_type" return (FIELD_TYPE);
- X"field_edits" return (FIELD_TYPE);
- X"field_adjust" return (FIELD_ADJUST);
- X"field_mustenter" return (FIELD_MUSTENTER);
- X"field_prompt" return (FIELD_PROMPT);
- X"field_terminator" return (FIELD_TERMINATOR);
- X"field_defaults" return (FIELD_DEFAULTS);
- X"field_noinput" return (FIELD_NOINPUT);
- X
- X"ENDSCREEN" return(0);
- X
- X
- X%{ /* Comment line */
- X%}
- X### { while (input() != '\n'); }
- X
- X[0-9]+ {
- X yylval.number = atoi (yytext);
- X return (NUMBER);
- X }
- X
- X%{ /* Alphanumeric string with a leading $ and alphabetic character. */
- X%}
- X[$][A-Za-z][A-Za-z0-9_]* {
- X yylval.string = malloc(strlen(yytext)+1);
- X strcpy(yylval.string,yytext);
- X return (EVAR);
- X }
- X
- X%{ /* Alphanumeric string with a leading alphabetic character. */
- X%}
- X[A-Za-z][A-Za-z0-9_]* {
- X yylval.string = malloc(strlen(yytext)+1);
- X strcpy(yylval.string,yytext);
- X return (STRING);
- X }
- X
- X%{/* Quoted string with a possible " in the string. ex. "abc\"def" */
- X%}
- X\"[^"]* {
- X if (yytext[yyleng-1] == '\\')
- X {
- X yymore ();
- X }
- X else
- X {
- X int i,j;
- X /*
- X ** need to validate that it is a quote
- X ** a core dump will occur if not.
- X */
- X input (); /* get last " */
- X yylval.string=malloc(strlen(yytext)+1);
- X for (j=0,i=1; i < strlen(yytext); i++)
- X {
- X if (yytext[i] == '\\' &&
- X yytext[i+1] == '"')
- X continue;
- X yylval.string[j++] = yytext[i];
- X }
- X yylval.string[j] = '\0';
- X return (QUOTE_STRING);
- X }
- X }
- X
- X"," return (COMMA);
- X"=" return (EQUAL);
- X%{/* Ignore blank, tab, newline */
- X%}
- X[ \t\n] ;
- X%%
- SHAR_EOF
- chmod 0644 LexDeSrn.l || echo "restore of LexDeSrn.l fails"
- echo "x - extracting menu.hlp (Text)"
- sed 's/^X//' << 'SHAR_EOF' > menu.hlp &&
- XTABLE_OF_CONTENTS
- Xmenu.hlp menu Menus - Help using menus.
- Xmenu.hlp popmenu Pop-menus - Help using popmenus.
- Xmenu.hlp GETINPUT Input - Editing commands.
- Xmenu.hlp help Help - Using help.
- XTABLE_OF_CONTENTS
- X
- X
- Xmenu
- X.TITLE Menu Help
- X
- X \RMENU COMMANDS:\N
- X M \D- Go directly to main menu.\N
- X P \D- Return to previous menu.\N
- X G or ^g \D- Go directly to a specific menu.\N
- X H or ? \D- This help screen.\N
- X ^r \D- Redraw the screen.\N
- X E \D- Exit.\N
- X ! \D- Enter a unix command.\N
- X
- X \RSELECTING OPTIONS:\N
- X - Use "up arrow key", "^k", "down arrow key", "^j" or
- X "tab key" to place bar on option and press "return".
- X
- X or
- X
- X - Enter option number and press "return".
- X
- Xmenu
- X
- X
- Xpopmenu
- X.TITLE Pop-Up Menu Help
- XSELECTING OPTIONS:
- X Use "up arrow key", "^k", "down arrow key", "^j",
- X to place bar on option and press "return".
- X
- X or
- X
- X Enter the first character of the option you
- X wish to select and press "return".
- X
- X KEY_CANCEL (esc) - Cancel selection.
- Xpopmenu
- X
- X
- XGETINPUT
- X.TITLE GETINPUT Help
- XMover Keys:
- X KEY_RETURN (^m) Traverse forwards through the fields.
- X KEY_DOWN (^j) Traverse forwards through the fields.
- X KEY_UP (^k) Traverse backwards through the fields.
- X KEY_TAB (^i) Fast forward through the fields.
- X KEY_BTAB Fast reverse through the fields.
- XField Editing Keys:
- X KEY_BEG (^b) Place cursor at beginning of field.
- X KEY_END (^e) Place cursor at end of input in field.
- X KEY_RIGHT (^l) Forward space within the field.
- X KEY_LEFT (^h) Backspace within the field (non-destructive).
- X KEY_BACKSPACE (^h) Same as KEY_LEFT.
- X KEY_EOL (^d) Delete from cursor to end of field.
- X KEY_DL (^c) Clear field and home cursor.
- X KEY_DC (^x) Delete a character.
- X KEY_IC (^t) Toggle between type-over and insert mode.
- XOther Keys:
- X KEY_HELP (?) Display help screen.
- X KEY_REFRESH (^r) Redraw the screen.
- X KEY_ACCEPT (^a) Accept all input and exit screen.
- X KEY_CANCEL (esc) Cancel all input and exit screen.
- X KEY_SAVE (^f) Save screen to a file.
- X KEY_PRINT (^p) Print screen to lp.
- XGETINPUT
- X
- X
- Xhelp
- X.TITLE Using Help
- XHelp displays consist of a description displayed in a window.
- XIf the description doesn't fit in the window, the Up Arrow and
- XDown Arrow keys can be used to view a few more lines of the
- Xdisplay. Exiting the help system will return the display to
- Xthe state it was in when you asked for help.
- X
- X The following keys are active in help:
- X KEY_CANCEL (esc) Exit help.
- X KEY_DOWN (^j) View a few more lines.
- X KEY_UP (^k) View the previous lines.
- X KEY_BEG (^b) Display first page.
- X KEY_END (^e) Display last page.
- X KEY_TOC (^t) Display help table of contents.
- Xhelp
- SHAR_EOF
- chmod 0644 menu.hlp || echo "restore of menu.hlp fails"
- echo "x - extracting runrealid.c (Text)"
- sed 's/^X//' << 'SHAR_EOF' > runrealid.c &&
- X#ifndef LINT
- Xstatic char Sccsid[] = "@(#)runrealid.c 1.1 DeltaDate 1/22/90 ExtrDate 1/22/90";
- X#endif
- X
- X#include <stdio.h>
- X
- Xmain ( argc, argv )
- X int argc;
- X char *argv[];
- X{
- X register int uid, euid, gid, egid ;
- X
- X /* who am i */
- X uid = getuid() ;
- X euid = geteuid() ;
- X gid = getgid() ;
- X egid = getegid() ;
- X
- X /* reset back to the read id */
- X setuid( uid ) ;
- X setgid( gid ) ;
- X
- X system( argv[1] ) ;
- X
- X /* reset back to the fake id */
- X setuid( euid ) ;
- X setgid( egid ) ;
- X}
- X/* Sam S. Lok 11/89 */
- SHAR_EOF
- chmod 0444 runrealid.c || echo "restore of runrealid.c fails"
- echo "x - extracting ParseDeSrn.y (Text)"
- sed 's/^X//' << 'SHAR_EOF' > ParseDeSrn.y &&
- X%{
- X#ifndef LINT
- Xstatic char Sccsid[] = "%W% DeltaDate %G% ExtrDate %H%";
- X#endif
- X%}
- X
- X%{
- X#include <curses.h>
- X#include "GetInput.h"
- X#include "menu.h"
- X
- X#define FLD yyscreen->field[fieldcount-1]
- X
- X#ifdef _yydebug
- Xextern int yydebug;
- X#endif
- Xextern int debug;
- Xstruct ScreenInfo *yyscreen;
- Xint fieldcount;
- Xchar eott[50]; /* error on this token */
- Xchar *malloc();
- X%}
- X%{
- X/*
- X** The %union declares yylval and the Yacc value stack as a C language
- X** union of types specified in the body.
- X**
- X** The %type assigns member declared in the %union to non-terminals.
- X** The %token <..> assigns member declared in the %union to terminals.
- X*/
- X%}
- X%union{
- X int number;
- X char *string;
- X}
- X
- X%token <number> NUMBER
- X%token <string> STRING
- X%token <string> QUOTE_STRING
- X%token <string> EVAR
- X%token COMMA EQUAL
- X%token SCREEN_TITLE SCREEN_ROWS SCREEN_COLS SCREEN_BORDER SCREEN_POS
- X%token SCREEN_HELP EXIT_LAST_FIELD
- X%token FIELD_NAME FIELD_LABEL FIELD_ROW FIELD_COL FIELD_MASK FIELD_RANGE
- X%token FIELD_LENGTH FIELD_MIN FIELD_TYPE FIELD_ADJUST FIELD_MUSTENTER
- X%token FIELD_TERMINATOR FIELD_PROMPT FIELD_DEFAULTS FIELD_NOINPUT
- X
- X%%
- X
- X
- Xscreen : valid_field
- X | screen valid_field
- X | screen COMMA valid_field
- X ;
- X
- Xvalid_field : screen_pos
- X {
- X strcpy (eott, "window_pos");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> window_pos");
- X fflush (stderr);
- X }
- X }
- X ;
- X | screen_rows
- X {
- X strcpy (eott, "window_rows");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> window_rows");
- X fflush (stderr);
- X }
- X }
- X ;
- X | screen_cols
- X {
- X strcpy (eott, "window_cols");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> window_cols");
- X fflush (stderr);
- X }
- X }
- X ;
- X | screen_border
- X {
- X strcpy (eott, "window_border");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> window_border");
- X fflush (stderr);
- X }
- X }
- X ;
- X | screen_title
- X {
- X strcpy (eott, "window_title");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> window_title");
- X fflush (stderr);
- X }
- X }
- X ;
- X | screen_help
- X {
- X strcpy (eott, "helpfile");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> helpfile");
- X fflush (stderr);
- X }
- X }
- X ;
- X | exit_last_field
- X {
- X strcpy (eott, "exit_last_field");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> exit_last_field");
- X fflush (stderr);
- X }
- X }
- X ;
- X
- X | field_name
- X {
- X strcpy (eott, "field_name");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_name");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_label
- X {
- X strcpy (eott, "field_label");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_label");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_row
- X {
- X strcpy (eott, "field_row");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_row");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_col
- X {
- X strcpy (eott, "field_col");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_col");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_mask
- X {
- X strcpy (eott, "field_mask");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_mask");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_range
- X {
- X strcpy (eott, "field_range");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_range");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_length
- X {
- X strcpy (eott, "field_length");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_length");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_min
- X {
- X strcpy (eott, "field_min");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_min");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_type
- X {
- X strcpy (eott, "field_edits");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_edits");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_adjust
- X {
- X strcpy (eott, "field_adjust");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_adjust");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_mustenter
- X {
- X strcpy (eott, "field_mustenter");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_mustenter");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_prompt
- X {
- X strcpy (eott, "field_prompt");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_prompt");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_terminator
- X {
- X strcpy (eott, "field_terminator");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_terminator");
- X fflush (stderr);
- X }
- X }
- X ;
- X | field_defaults
- X {
- X strcpy (eott, "field_defaults");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_defaults");
- X fflush (stderr);
- X }
- X }
- X ;
- X
- X | field_noinput
- X {
- X strcpy (eott, "field_noinput");
- X if (debug)
- X {
- X fprintf (stderr,
- X "\n[ParseDeSrn]<.DEFINE_SCREEN> field_noinput");
- X fflush (stderr);
- X }
- X }
- X ;
- X
- X
- Xscreen_title : SCREEN_TITLE EQUAL STRING
- X {
- X strcpy (yyscreen->title, $3);
- X }
- X | SCREEN_TITLE EQUAL EVAR
- X {
- X strcpy (yyscreen->title, $3);
- X /*
- X strcpy (yyscreen->title, (char *)getval (&$3,'1'));
- X */
- X }
- X | SCREEN_TITLE EQUAL QUOTE_STRING
- X {
- X strcpy (yyscreen->title, $3);
- X /*
- X strcpy (yyscreen->title, (char *)getval (&$3, '1'));
- X */
- X }
- X ;
- X
- Xscreen_help : SCREEN_HELP EQUAL STRING
- X {
- X strcpy (yyscreen->helpfile, $3);
- X }
- X | SCREEN_HELP EQUAL QUOTE_STRING
- X {
- X strcpy (yyscreen->helpfile, $3);
- X }
- X ;
- X
- Xscreen_pos : SCREEN_POS EQUAL NUMBER NUMBER
- X {
- X yyscreen->toprow = $3;
- X yyscreen->leftcol = $4;
- X }
- X | SCREEN_POS EQUAL EVAR EVAR
- X {
- X strcpy (yyscreen->toprowvar, $3);
- X strcpy (yyscreen->leftcolvar, $4);
- X /*
- X yyscreen->toprow = atoi ((char *)getval (&$3, '1'));
- X yyscreen->leftcol = atoi ((char *)getval (&$4, '1'));
- X */
- X }
- X | SCREEN_POS EQUAL NUMBER EVAR
- X {
- X yyscreen->toprow = $3;
- X strcpy (yyscreen->leftcolvar, $4);
- X }
- X | SCREEN_POS EQUAL EVAR NUMBER
- X {
- X /*
- X yyscreen->toprow = atoi ((char *)getval (&$3, '1'));
- X */
- X strcpy (yyscreen->toprowvar, $3);
- X yyscreen->leftcol = $4;
- X }
- X ;
- X
- Xscreen_rows : SCREEN_ROWS EQUAL NUMBER
- SHAR_EOF
- echo "End of part 6"
- echo "File ParseDeSrn.y is continued in part 7"
- echo "7" > s2_seq_.tmp
- exit 0
-