X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/2b84abb596f52ab2068d52108adc96838ad4340a..31cef89cb428866f787983e68246030321893df4:/usr/src/cmd/ex/ex.h diff --git a/usr/src/cmd/ex/ex.h b/usr/src/cmd/ex/ex.h index 9493541ce1..0a7cbb6904 100644 --- a/usr/src/cmd/ex/ex.h +++ b/usr/src/cmd/ex/ex.h @@ -1,10 +1,11 @@ -/* Copyright (c) 1979 Regents of the University of California */ +/* Copyright (c) 1980 Regents of the University of California */ +/* sccs id: @(#)ex.h 6.1 10/18/80 */ #ifdef V6 #include #endif /* - * Ex version 3.1 + * Ex version 3 (see exact version in ex_cmds.c, search for /Version/) * * Mark Horton, UC Berkeley * Bill Joy, UC Berkeley @@ -29,25 +30,40 @@ * * Please forward bug reports to * - * Bill Joy + * Mark Horton * Computer Science Division, EECS * EVANS HALL * U.C. Berkeley 94704 * (415) 642-4948 * (415) 642-1024 (dept. office) * - * or to wnj@mit-mc on the ARPA-net. I would particularly like to hear + * or to csvax.mark@berkeley on the ARPA-net. I would particularly like to hear * of additional terminal descriptions you add to the termcap data base. */ #include #include #include -#include #include #include #include +/* + * The following little dance copes with the new USG tty handling. + * This stuff has the advantage of considerable flexibility, and + * the disadvantage of being incompatible with anything else. + * The presence of the symbol USG3TTY will indicate the new code: + * in this case, we define CBREAK (because we can simulate it exactly), + * but we won't actually use it, so we set it to a value that will + * probably blow the compilation if we goof up. + */ +#ifdef USG3TTY +#include +#define CBREAK xxxxx +#else +#include +#endif + extern int errno; #ifndef VMUNIX @@ -108,11 +124,11 @@ struct option options[NOPTS + 1]; # undef putchar # undef getchar #else -#ifdef VMUNIX +# ifdef VMUNIX # define BUFSIZ 1024 -#else +# else # define BUFSIZ 512 -#endif +# endif # define NULL 0 # define EOF -1 #endif @@ -142,6 +158,9 @@ int chng; /* Warn "No write" */ char *Command; short defwind; /* -w# change default window size */ int dirtcnt; /* When >= MAXDIRT, should sync temporary */ +#ifdef TIOCLGET +bool dosusp; /* Do SIGTSTP in visual when ^Z typed */ +#endif bool edited; /* Current file is [Edited] */ line *endcore; /* Last available core location */ bool endline; /* Last cmd mode command ended with \n */ @@ -154,6 +173,7 @@ char genbuf[LBSIZE]; /* Working buffer when manipulating linebuf */ bool hush; /* Command line option - was given, hush up! */ char *globp; /* (Untyped) input string to command mode */ bool holdcm; /* Don't cursor address */ +bool inappend; /* in ex command append mode */ bool inglobal; /* Inside g//... or v//... */ char *initev; /* Initial : escape for visual */ bool inopen; /* Inside open or visual */ @@ -173,6 +193,7 @@ line names['z'-'a'+2]; /* Mark registers a-z,' */ int notecnt; /* Count for notify (to visual from cmd) */ bool numberf; /* Command should run in number mode */ char obuf[BUFSIZ]; /* Buffer for tty output */ +short oprompt; /* Saved during source */ short ospeed; /* Output speed (from gtty) */ int otchng; /* Backup tchng to find changes in macros */ short peekc; /* Peek ahead character (cmd mode input) */ @@ -183,18 +204,25 @@ int ppid; /* Process id of parent (e.g. main ex proc) */ jmp_buf resetlab; /* For error throws to top level (cmd mode) */ int rpid; /* Pid returned from wait() */ bool ruptible; /* Interruptible is normal state */ +bool seenprompt; /* 1 if have gotten user input */ bool shudclob; /* Have a prompt to clobber (e.g. on ^D) */ int status; /* Status returned from wait() */ int tchng; /* If nonzero, then [Modified] */ short tfile; /* Temporary file unit */ bool vcatch; /* Want to catch an error (open/visual) */ jmp_buf vreslab; /* For error throws to a visual catch */ +bool writing; /* 1 if in middle of a file write */ int xchng; /* Suppresses multiple "No writes" in !cmd */ /* * Macros */ #define CP(a, b) (ignore(strcpy(a, b))) + /* + * FIXUNDO: do we want to mung undo vars? + * Usually yes unless in a macro or global. + */ +#define FIXUNDO (inopen >= 0 && (inopen || !inglobal)) #define ckaw() {if (chng && value(AUTOWRITE)) wop(0);} #define copy(a,b,c) Copy((char *) a, (char *) b, c) #define eq(a, b) ((a) && (b) && strcmp(a, b) == 0) @@ -217,9 +245,9 @@ int xchng; /* Suppresses multiple "No writes" in !cmd */ * Environment like memory */ char altfile[FNSIZE]; /* Alternate file name */ -char direct[32]; /* Temp file goes here */ -char shell[32]; /* Copied to be settable */ -char ttytype[16]; /* A long and pretty name */ +char direct[ONMSZ]; /* Temp file goes here */ +char shell[ONMSZ]; /* Copied to be settable */ +char ttytype[ONMSZ]; /* A long and pretty name */ char uxb[UXBSIZE + 2]; /* Last !command for !! */ /* @@ -271,6 +299,22 @@ line *undadot; /* If we saved all lines, dot reverts here */ #define UNDNONE 3 #define UNDPUT 4 +#ifdef CRYPT +/* + * Various miscellaneous flags and buffers needed by the encryption routines. + */ +#define KSIZE 9 /* key size for encryption */ +#define KEYPROMPT "Key: " +int xflag; /* True if we are in encryption mode */ +int xtflag; /* True if the temp file is being encrypted */ +int kflag; /* True if the key has been accepted */ +char perm[768]; +char tperm[768]; +char *key; +char crbuf[CRSIZE]; +char *getpass(); +#endif + /* * Function type definitions */ @@ -328,6 +372,7 @@ int numbline(); int (*oldquit)(); int onhup(); int onintr(); +int onsusp(); int putch(); int shift(); int termchar();