TVX: PD Editor (6 of 7, repost)

wampler at unmvax.UUCP wampler at unmvax.UUCP
Fri Jan 17 03:31:53 AEST 1986


#--------CUT---------CUT---------CUT---------CUT--------#
#########################################################
#                                                       #
# This is a shell archive file.  To extract files:      #
#                                                       #
#    1)	Make a directory (like tvx) for the files.      #
#    2) Write a file, such as "filen.shar", containing  #
#       this archive file into the directory.           #
#    3) Type "sh file.shar".  Do not use csh.           #
#                                                       #
#########################################################
#
#
echo Extracting tvx_defs.ic:
sed 's/^X//' >tvx_defs.ic <<\SHAR_EOF
X/* ----------------------------->>> tvx_defs.ic <<<---------------------
X  TVX - A full screen editor written in C
X
X  Revison summary:
X      Version
X	7/15/85 - Official Public Release Version
X	7/18/85 -  added -b (-b to -l, -b new) switch for Unix compatibility
X	8/22/85 -  fixed bug with setdscrl
X	9/20/85 -  major revision:   some minor bug fixes
X		   added editrpt, storerpt, execrpt, spare1, spare2
X		   major changes to file handling
X	9/30/85 -  of course, bugs...
X	10/6/85 -  I like this date.
X	10/18/85 - bug in autoindent with insert message
X	10/25/85 - 0<tab>, ^A wild to ^C because of insert problem
X	11/7/85 -  Atari version
X	11/12/85 - get find pattern added, some LASL stuff added, lex_def added
X		   ^C back to ^A
X	11/15/85 - added write save buffer
X	11/25/85 - minor bug with auto insert ### ins mode ### + reset in main
X	11/26/85 - added BUFFINDEX type for atari
X	11/27/85 - bug in lex_default with loops
X	1/10/86	 - small bug in memory with long file names
X	
X
X*********************************************************************  */
X
X#include <stdio.h>
X
X#define NEED_MISC_DEFS /**/
X/* ======================================================================== */
X#ifdef NEED_MISC_DEFS
X/* following definitons are usually not defined in most stdio.h's */
X
X#define NIL (-1)		/* nil ptr for lists */
X#define TRUE 1
X#define FALSE 0
X#define FAST static
X#define SLOW static
X
X/* following might not be defined in some C's stdio.h, but usually are */
X
X/* #define EOF (-1) */	/* standard end of file */
X/* #define EOS '\0' */	/* standard end of string */
X#endif
X/* ======================================================================== */
X
X#define VERSION " - TVX (1/10/86) - " 
X
X/* ======================================================================== */
X/* ====> Select terminal version: #define at most ONE of <================= */
X/*       the following symbols debending the terminal used. (except SUN)    */
X
X#undef IBMPC
X/* #define ATARI520 */
X/* #define VT100 */
X/* #define HP2621 */
X#define TERMCAP 			/* Unix TERMCAP version */
X/* #define SUN */		/* define for SUN in addition to TERMCAP */
X
X/* ======================================================================== */
X/* ==================> Select ONE operating system  <====================== */
X
X/* #define OSCPM */		/* CP/M-80 */
X#undef MSDOS			/* 8086 MS-DOS */
X#undef GEMDOS			/* atari 520 gemdos */
X
X#define UNIX 		/* unix is a bit different! */
X
X/* ======================================================================== */
X/* ========> select other options by defining appropriate symbols <======== */
X
X#define VB /**/		/* whether or not to create backup log version */
X
X#undef ULBD		/* supports underline, bold in ^U, ^B format */
X
X#define STATREPEAT	/* define for Rpt: on status line (undef STATCURLINE) */
X
X#undef STATCURLINE	/* define for Cur line on stat line (undef STATREPEAT) */
X
X
X/* ********************************************************************** */
X/* ********************************************************************** */
X
X/*  Other options now selected automatically depending on above #defines  */
X
X/* ********************************************************************** */
X/* ********************************************************************** */
X
X/* ---------------- Operating System dependent defintions --------------- */
X
X/* important note: max value for REPEATBUFS is 9! 			  */
X
X/* ---------------------------------------------------------------------- */
X#ifdef OSCPM			/* uses Software Toolworks C/80 */
X#define BACKUPNAME "BACKUP.LOG"	/* backup log file name */
X#define BUFFLIMIT 2500		/* how much empty space to save in buffer */
X#define FILEREAD "rb"		/* read a file in binary */
X#define FILEWRITE "wb"		/* write a binary file */
X#define FNAMESIZE 14		/* size of file names */
X#define INT16 /**/		/* ints are 16 bits */
X#define LINELIMIT 75		/* number of spare lines to save */
X#define MAKE_BACKUP 1		/* 1 (true), want to make .bak file by default */
X#define MAXBUFF 40000		/* maximum number of total characters */
X#define MAXLINE 1150		/* maximum number of lines (abt. MAXBUFF/30) */
X#define REPEATBUFS 3		/* number of repeat buffers allowed */
X#define USELF /**/		/* using line feed on video */
X#define FILELF /**/			/* also in files */
X#define NEWLINE 13		/* 1st line separator: CR */
X#define USECTRLZ /**/
X#define NEEDTVLIB /**/		/* need standard c lib routines */
X#define BUFFINDEX unsigned int
X#endif
X
X/* ---------------------------------------------------------------------- */
X#ifdef MSDOS
X#define HELP /**/		/* help available */
X#define FULLHELP /**/		/* all of it */
X#define CONFIGFILE /**/		/* allow -c switch */
X#define BACKUPNAME "BACKUP.LOG"	/* backup log file name */
X#define BUFFLIMIT 3000		/* how much empty space to save in buffer */
X#define FILEREAD "rb"		/* read a file in binary */
X#define FILEWRITE "wb"		/* write a binary file */
X#define FNAMESIZE 70		/* size of file names, allows paths */
X#define INT16 /**/		/* ints are 16 bits */
X#define LINELIMIT 75		/* number of spare lines to save */
X#define MAKE_BACKUP 1		/* 1 (true), want to make .bak file by default */
X#define MAXBUFF 60000		/* maximum number of total characters */
X#define MAXLINE 3500		/* maximum number of lines (abt. MAXBUFF/30) */
X#define REPEATBUFS 5		/* number of repeat buffers allowed */
X#define USELF /**/		/* using line feed */
X#define FILELF	/**/		/* also in files */
X#define NEWLINE 13		/* 1st line separator: CR */
X#define BUFFINDEX unsigned int
X/* #define USECTRLZ */
X#endif
X/* ---------------------------------------------------------------------- */
X/* ---------------------------------------------------------------------- */
X#ifdef GEMDOS
X#define HELP /**/		/* help available */
X#define FULLHELP /**/		/* all of it */
X#define CONFIGFILE /**/		/* allow -c switch */
X#define BACKUPNAME "BACKUP.LOG"	/* backup log file name */
X#define BUFFLIMIT 3000		/* how much empty space to save in buffer */
X#define FILEREAD "r"		/* read a file in binary */
X#define FILEWRITE "w"		/* write a binary file */
X#define fopen fopenb
X#define FNAMESIZE 70		/* size of file names, allows paths */
X#define INT16 /**/		/* ints are 16 bits */
X#define LINELIMIT 75		/* number of spare lines to save */
X#define MAKE_BACKUP 1		/* 1 (true), want to make .bak file by default */
X#define MAXBUFF 60000		/* maximum number of total characters */
X#define MAXLINE 3500		/* maximum number of lines (abt. MAXBUFF/30) */
X#define REPEATBUFS 5		/* number of repeat buffers allowed */
X#define USELF /**/		/* using line feed */
X#define FILELF /**/		/* also in files */
X#define NEWLINE 13		/* 1st line separator: CR */
X#define USECTRLZ /**/
X#define BUFFINDEX long
X#endif
X/* ---------------------------------------------------------------------- */
X
X/* ---------------------------------------------------------------------- */
X#ifdef UNIX
X#define getchr fgetc
X#define FLOWCONTROL /**/	/* define this if you want ^S/^Q enabled */
X#undef COMMA_BAK		/* #define if you want ".," backup files */
X#define NO_EXTEND_CHAR		/* only allow 127 displayable chars */
X
X#define HELP /**/		/* help available */
X#define FULLHELP /**/		/* all of it */
X#define CONFIGFILE /**/		/* allow -c switch */
X#define BACKUPNAME "BACKUP.LOG"	/* backup log file name */
X#define BUFFLIMIT 4000		/* how much empty space to save in buffer */
X#define FILEREAD "r"		/* read a file in binary */
X#define FILEWRITE "w"		/* write a binary file */
X#define FNAMESIZE 80		/* size of file names, allows paths */
X#define LINELIMIT 100		/* number of spare lines to save */
X#define MAKE_BACKUP 1		/* 1 (true), want to make .B file by default */
X		/* change to 0 if don't want, which is like other Unix eds */
X#define MAXBUFF 120000		/* maximum number of total characters */
X#define MAXLINE 5000		/* maximum number of lines (abt. MAXBUFF/30) */
X#define NEWLINE 10
X#define REPEATBUFS 9		/* number of repeat buffers allowed */
X#define USELF /**/		/* using line feed on screen */
X#define BUFFINDEX unsigned int
X#endif
X/* ---------------------------------------------------------------------- */
X
X/* ---------------------------------------------------------------------- */
X/* ---------------------- Misc defintions ------------------------------- */
X
X#define ARB 100
X#define ALMOSTOUT 300   /* garbage collect when ALMOSTOUT characters left */
X#define BACKSPACE 8
X#define BEGLINE (-10)  /* marks beginning of active line */
X#define BELL 7       /* bell */
X#define CR 13 
X#define ESC 27 
X#define ENDFILE 26
X#define ENDLINE 0  /* marks end of a line */
X#define GARBAGE (-14)  /* filler character for gbgcol */
X#define LF 10 
X#define NO 0
X#define TOGUNDERLINE 21 	/* ^U for underline */
X#define TOGBOLD 2 		/* ^B for bold */
X#define TAB 9
X#define YES 1
X
X#define E0 0			/* element 0 of arrays (skipped) */
X
X/* ---------------------- Wild card values ----------------------------------- */
X#define W_letter 12		/* ^L is letter */
X#define W_digit 4		/* ^D is digit */
X#define W_alpha 1		/* ^A is alpha num */
X#define W_punc 16		/* ^P is punctuation */
X#define W_anything 24		/* ^X is any character */
X#define W_others 15		/* ^O is non-alpha */
X#define W_user 21		/* ^U is user set */
X#define W_span 23		/* ^W is "word" of */
X#define W_skip 14		/* ^N is not in word of*/
X/* -------------------- Command Definitions ----------------------------- */
X
X#define VRIGHT 1		/* lex val right, or foward one character */
X#define VLEFT 2 		/* left or backwards one character */
X#define VDOWNLINE 3		/* down line, to beg. of next line */
X#define VUPLINE 4		/* up line, to beg. of prev. line */
X#define VDOWNCOL 5		/* down in column ^D */
X#define VUPCOL 6		/* up in column ^U */
X#define VDELLAST 7		/* delete previous character */
X#define VDELNEXT 8		/* delete forward */
X#define VINSERT 9		/* insert text */
X#define VKILLALL 10		/* kill entire current line */
X#define VKILLREST 11		/* kill rest of current line */
X#define VKILLPREV 12		/* kill previous part of line */
X#define VBEGLINE 13		/* beginning of current line */
X#define VENDLINE 14		/* back of current line */
X#define VSEARCH 15		/* find a string */
X#define VNEXT 16		/* next - search across pages */
X#define VFLIP 17		/* page a screen full */
X#define VTOP 18			/* top of buffer */
X#define VBOTTOM 19		/* bottom of buffer */
X#define VFBEGIN 20		/* beginning of file */
X#define VVERIFY 21		/* verify: rewrite screen or show dot */
X#define VOPENLINE 22		/* open a new line */
X#define VREMOVE 23		/* remove last thing maniuplated */
X#define VSAVE 24		/* put text in save buffer */
X#define VGET 25			/* get or restore save buffer */
X#define VWPAGE 26		/* write current page, fetch next page */
X#define VYANK 27		/* "save" from external file */
X#define VQUIT 28		/* quit */
X#define VSAGAIN 29		/* search for the thing again */
X#define VXREPEAT 30		/* execute repeat buffer */
X#define VMEMORY 31		/* print remaining buffer space */
X#define VSETPARS 32		/* set parameters */
X#define VRMVINS 33		/* remove last, enter insert mode */
X#define VUNKILL 34		/* unkill last line killed */
X#define VMVWORD 35		/* move over a word at a time */
X#define VMVBWORD 36		/* move over words backwards */
X#define VSAPPEND 37		/* append to save buffer */
X#define VPRINTS 38		/* print screen */
X#define VHELP 39		/* show contents of repeat buffer */
X#define VHALFP 40		/* half a page down */
X#define VABORT 41		/* abort */
X#define VCHANGE 42		/* change n chars */
X#define VJUMP 43		/* jump back to prev loc */
X#define VTIDY 44		/* tidy - justify */
X#define VNOTELOC 45		/* note current location */
X#define VRETNOTE 46		/* ^N  - Return to noted loc */
X#define VSYSTEM 47		/* call operating system */
X#define VEDITRPT 48		/* edit repeat buffer n */
X#define VSTORERPT 49		/* store in repeat buffer n */
X#define VEXECRPT 50		/* execute repeat buffer k n time */
X#define VINSPAT 51		/* insert search pattern */
X#define VUSER1 52		/* spare 1 */
X#define VUSER2 53		/* spare 2 */
X
X#define SLOOPBEG '<'		/* beginning of a loop */
X#define SLOOPEND '>'		/* end of a loop */
X
X#define LEXVALUES 53		/* total number of lexical values */
X#define UNKNOWN (-5)		/* unknown lexical value */
X
X/* ********************************************************************* */
SHAR_EOF
echo Extracting tvx_glbl.ic:
sed 's/^X//' >tvx_glbl.ic <<\SHAR_EOF
X/* -------------------->>> tvx_glbl.ic <<<----------------------------- */
X/* ---------------   TVX global declarations   ------------------------ */
X
X/*
X   Following trick allows only one file for externals.  If EXTERN is not
X   defined, then variables are decleared extern.  ONE module, tvlex.c,
X   defines EXTERN, and thus actually declares things.  If you need to
X   change one of these values (terminal definition, for example), then
X   only tvlex.c needs to be recompiled!
X*/
X#ifndef EXTERN
X#define EXTERN extern
X#define USEEXTERN /**/
X#endif
X
X/* constants defined within the next #ifndef area are the important
X   system values that define the terminal, margins, etc.  ALL variables
X   between begpatch and endpatch must be initialized for the MS-DOS cii-86
X   compiler to put them all in the same contiguous memory area.
X   This allows the tvconfig program to work properly to find the #####:
X   patch area patern.  This works on the C/80 CP/M version, too, but
X   has never been tried on unix since the termcap driver is normally used.
X*/
X
X#ifndef USEEXTERN
X    EXTERN char begpatch[6] = {'#','#','#','#','#',':'};
X
X#include "tvx_term.ic"		/* include terminal definitions */
X
X/* define standard command set */
X    EXTERN char lexsym[LEXVALUES+1] = { E0, 'r', 'l', 'd', 'u',
X      4, 21, 8, 'k', 'i', 11, '"', '\'', ',', '.', 'f', 6, 'p',
X      'b', 'e', 2, 'v', 'o', '/', 's', 'g', 23, 25, 24, ';', '&',
X      'm', ':', '=', 7, 9, '{', 'a', 16, '?', 'h', 20, 'c', 'j', 't',
X      'n', 14, 15, 5, 18, '#', '*','(', ')' };
X
X    EXTERN char user_set[40] = "";		/* user search set */
X    EXTERN char use_wild = 1;			/* use wild cards by default */
X    EXTERN char old_cmds[16] = {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 };
X    EXTERN int old_cindex = 0;			/* cursor into old_cmds */
X
X#ifdef MSDOS
X    EXTERN char cfgname[40] = "-c=\\bin\\config.tvx";
X#endif
X#ifdef GEMDOS
X    EXTERN char cfgname[40] = "-c=config.tvx";
X#endif
X#ifdef UNIX
X    EXTERN char cfgname[40] = "-c=config.tvx";
X#endif
X#ifdef OSCPM
X    EXTERN char cfgname[40] = "-c=a:config.tvx";
X#endif
X    EXTERN int endpatch = 0;	/* to get address of end of patch area */
X
X#else
X    EXTERN char begpatch[6];
X    EXTERN int addx,		/* amount to add to get x */
X	addy;			/* to get y */
X    EXTERN char cxychr;		/* true if convert xy bin to ascii */
X    EXTERN char cversn[12],	/* a version to identify config */
X	cxy1st,			/* l if line first, c if column 1st */
X	cxybeg[8],		/* start xy control seq */
X	cxymid[8],		/* middle xy control seq */
X	cxyend[8],		/* end sequence */
X	cerrbg[8],		/* string to print when errors start */
X	cerred[8],		/* when errors done */
X	ctopb[8],		/* top blanks = reverse linefeed */
X	cinit[20],		/* start up sequence */
X	cendit[20],		/* to end session */
X	cbotb[8],		/* bottom sequence */
X	celin[8],		/* erase to end of line */
X	cescr[8],		/* erase to end of screen */
X	ccsrcm[8],		/* set cursor to command mode */
X	ccsrin[8],		/* set cursor to insert mode */
X	ciline[8],		/* insert a line */
X	ckline[8],		/* kill a line */
X	cundlb[8],		/* turn on underline */
X	cundle[8],		/* turn off underline */
X	cboldb[8],		/* start bold */
X	cbolde[8];		/* end bold */
X
X    EXTERN int ddline,dscrl,dxcase,usecz,autoin,logdef;
X    EXTERN char delkey;
X
X    EXTERN int	tvlins,	/* number of lines on screen */
X		tvcols,	/* number of columns on screen */
X		tvhardlines,	/* real number of lines (for small window) */
X		tvx,	/* current x cursor position */
X		tvy,	/* current y cursor position */
X		tvdlin,	/* the "active" display line */
X		dsplin,	/* the default display line */
X		tabspc,	/* spacing for tabs */
X		leftmg,	/* left margin of display */
X		wraplm,	/* auto wrap? */
X		isibmpc; /* for possible use with a general version */
X
X    EXTERN char synofr[20],	/* from table */
X	synoto[20];		/* translate to table */
X
X    EXTERN char funkey,		/* leading char for function key */
X	funchar[50],	/* code sent by function key */
X	funcmd[50];	/* equivalent command */
X    EXTERN char lexsym[LEXVALUES+1];
X
X    EXTERN char user_set[40],			/* wild matches */
X	use_wild;
X
X    EXTERN char old_cmds[16];
X    EXTERN int old_cindex ;			/* cursor into old_cmds */
X
X    EXTERN char cfgname[40];
X
X    EXTERN int endpatch;	/* to get address of end of patch area */
X#endif
X
X
X    EXTERN int	bakpos,		/* used when building log file */
X		bakflg,		/* if writing to log file */
X		usebak,		/* if want to build a log file or not */
X		makebackup;	/* if want to retain backup .bak file */
X
X    EXTERN BUFFINDEX nxtsav,	/* top of save buffer */
X		curchr,		/* pointer to current character */
X		nxtchr,		/* ptr to buff of next new chr */
X		mxbuff,		/* maximum number of chars in buff */
X		*lines;		/* line ptrs */
X
X    EXTERN int 	curlin,		/* pointer to current line */
X		nxtlin,		/* ptr to lines of next new line */
X		mxline;		/* maximum number of lines */
X
X    EXTERN char *buff;		/* character and save buffer */
X
X#ifdef NOALLOC
X    EXTERN int myline[MAXLINE+1];	/* the real line buffer */
X    EXTERN char mybuff[MAXBUFF+1];	/* the real buffer */
X#endif
X
X    EXTERN int	oldlen,		/* length for '=' command */
X		savlin,		/* number of saved lines */
X		savlen;		/* line lenght of save buffer for rmvlst */
X
X    EXTERN int	oldlex,		/* last commands lexical value */
X		oldcol,		/* beginning column for dwncol */
X		echof,		/* whether or not to echo action */
X		xcases,		/* exact case flag */
X		scroll;		/* scroll window */
X
X    EXTERN int newfil;		/* YES if creating a new file */
X    EXTERN int rdonly;		/* YES if reading a file only */
X
X    EXTERN char orig_file[FNAMESIZE+1],	/* original file */
X		source_file[FNAMESIZE+1], /* where file really is */
X		work_file[FNAMESIZE+1],	/* current working output file */
X		dest_file[FNAMESIZE+1];	/* ultimate name for file */
X
X    EXTERN int	rptuse,		    /* which repeat buffer currently active */
X		rptcnt[REPEATBUFS],	/* number of repeats left to do */
X		nxtrpt[REPEATBUFS],	/* pointer to next repeat character */
X		lstrpt[REPEATBUFS];	/* last good char in buffer */
X
X    EXTERN char rptbuf[REPEATBUFS][102]; /* up to 100 chars in repeat loop */
X    EXTERN char sbuff[102];		/* search buffer */
X    EXTERN char pat_buff[102];		/* save the pattern */
X
X/* other globals */
X#ifndef USEEXTERN
X    int slastl = 0;
X#else
X    extern int slastl;
X#endif
X
X    EXTERN char unkbuf[130];
X
X    EXTERN int useprint;	/* whether to print */
X    EXTERN int xoutcm;		/* used for 240 col virtual screen */
X    EXTERN int last_col_out;	/* last column output */
X    EXTERN int waserr;
X    EXTERN int blimit;		/* limit for read in buffer */
X    EXTERN int ttymode;		/* true if in tty mode */
X    EXTERN int ttynext;		/* cursor to next char from rdtty */
X    EXTERN int ins_mode;	/* true if insert mode */
X    EXTERN int force_tty;	/* for unix to force tty mode */
X
X
X    EXTERN FILE *infile, *outfile, *bkuin, *bkuout;
X    EXTERN int ineof;
X
X/* ---------------------------- GLOBALS ------------------------------- */
SHAR_EOF
echo Extracting tvx_term.ic:
sed 's/^X//' >tvx_term.ic <<\SHAR_EOF
X/* ------------------------>>> tvx_term.ic <<<----------------------------*/
X/* -----------------  Various terminal definitions ---------------------- */
X/* ********************************************************************** */
X#ifdef IBMPC
X    EXTERN int addx = 31;		/* amount to add to get x */
X    EXTERN int addy = 31;		/* to get y */
X    EXTERN char cxychr = 0;		/* true if convert xy bin to ascii */
X    EXTERN char cversn[12] = "IBM-PC";     /* a version to identify config */
X    EXTERN char cxy1st = 'l';			/* l if line first, c if column 1st */
X    EXTERN char cxybeg[8] = {18,0,0,0,0,0,0,0};	/* start xy control seq  */
X    EXTERN char cxymid[8] = {0,0,0,0,0,0,0,0};  /* middle xy control seq */
X    EXTERN char cxyend[8] = {0,0,0,0,0,0,0,0};  /* end sequence */
X    EXTERN char cerrbg[8] = {16,0,0,0,0,0,0,0}; /* string to print when errors start */
X    EXTERN char cerred[8] = {14,0,0,0,0,0,0,0};  /* when errors done */
X    EXTERN char ctopb[8] = {3,0,0,0,0,0,0,0}; /* top blanks = reverse linefeed */
X    EXTERN char cinit[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* start up sequence */
X    EXTERN char cendit[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* to end session */
X    EXTERN char cbotb[8] = {10,0,0,0,0,0,0,0};  /* bottom blank line sequence */
X    EXTERN char celin[8] = {1,0,0,0,0,0,0,0};	    /* erase to end of line */
X    EXTERN char cescr[8] = {2,0,0,0,0,0,0,0};	    /* erase to end of screen */
X    EXTERN char ccsrcm[8] = {20,0,0,0,0,0,0,0};	/* set cursor to command mode */
X    EXTERN char ccsrin[8] = {19,0,0,0,0,0,0,0};	/* set cursor to insert mode */
X    EXTERN char ciline[8] = {3,0,0,0,0,0,0,0};	    /* insert a line */
X    EXTERN char ckline[8] = {6,0,0,0,0,0,0,0};	    /* kill a line */
X    EXTERN char cundlb[8] = {4,0,0,0,0,0,0,0};	/* turn on underline */
X    EXTERN char cundle[8] = {5,0,0,0,0,0,0,0};	/* turn off underline */
X    EXTERN char cboldb[8] = {11,0,0,0,0,0,0,0};	/* start bold */
X    EXTERN char cbolde[8] = {12,0,0,0,0,0,0,0};	/* end bold */
X
X    EXTERN int ddline = 16;
X    EXTERN int dscrl = 0;
X    EXTERN int dxcase = 0;
X#ifdef USECTRLZ
X    EXTERN int usecz = 1;
X#else
X    EXTERN int usecz = 0;
X#endif
X    EXTERN int autoin = 0;	/* TRUE if auto indent, FALSE otherwise */
X    EXTERN int logdef = 0;	/* backup log file by default 0->no, 1-> yes */
X    EXTERN char delkey = 8;
X    EXTERN int tvlins = 25;	/* number of lines on screen */
X    EXTERN int tvcols = 80;	/* number of columns on screen */
X    EXTERN int tvhardlines = 25;	/* real number of lines */
X    EXTERN int tvx = 0;        /* current x cursor position */
X    EXTERN int tvy = 0;        /* current y cursor position */
X    EXTERN int tvdlin = 0;     /* the "active" display line */
X    EXTERN int dsplin = 0;     /* the default display line */
X    EXTERN int tabspc = 8;     /* spacing for tabs */
X    EXTERN int leftmg = 0;	/* left margin of display */
X    EXTERN int wraplm = 0;	/* auto wrap? */
X    EXTERN int isibmpc = 1;	/* for possible use with a general version */
X
X    EXTERN char synofr[20] =	/* from table */
X      {' ',13,'[',']',000,000,000,000,000,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char synoto[20] =		/* translate to table */
X      {'r','d','{','{',000,0,000,00,00,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char funkey = 0;		/* leading char for function key */
X    EXTERN char funchar[50] =	/* code sent by function key */
X      {	 /* make keypad function keys work like you would expect */
X	 71,  72,  73,  75,  77,  79,  82,  83,  80,  81,
X	 59, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X      };
X    EXTERN char funcmd[50] =	/* equivalent command */
X      {
X	'b',  21, 'h', 'l', 'r', 'e', 'i',  11,   4, 'p',
X	'&', 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X      };
X#endif
X/* ********************************************************************** */
X#ifdef TERMCAP
X    EXTERN int addx = 0;		/* amount to add to get x */
X    EXTERN int addy = 0;			/* to get y */
X    EXTERN char cxychr = 0;		/* true if convert xy bin to ascii */
X    EXTERN char cversn[12] = ":";     /* a version to identify config */
X    EXTERN char cxy1st = 0;			/* l if line first, c if column 1st */
X    EXTERN char cxybeg[8] = {0,0,0,0,0,0,0,0};	/* start xy control seq  */
X    EXTERN char cxymid[8] = {0,0,0,0,0,0,0,0};  /* middle xy control seq */
X    EXTERN char cxyend[8] = {0,0,0,0,0,0,0,0};  /* end sequence */
X    EXTERN char cerrbg[8] = {0,0,0,0,0,0,0,0}; /* string to print when errors start */
X    EXTERN char cerred[8] = {0,0,0,0,0,0,0,0};  /* when errors done */
X    EXTERN char ctopb[8] = {0,0,0,0,0,0,0,0}; /* top blanks = reverse linefeed */
X    EXTERN char cinit[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* start up sequence */
X    EXTERN char cendit[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* to end session */
X    EXTERN char cbotb[8] = {10,0,0,0,0,0,0,0};  /* bottom blank line sequence */
X    EXTERN char celin[8] = {0,0,0,0,0,0,0,0};	    /* erase to end of line */
X    EXTERN char cescr[8] = {0,0,0,0,0,0,0,0};	    /* erase to end of screen */
X    EXTERN char ccsrcm[8] = {0,0,0,0,0,0,0,0};	/* set cursor to command mode */
X    EXTERN char ccsrin[8] = {0,0,0,0,0,0,0,0};	/* set cursor to insert mode */
X    EXTERN char ciline[8] = {0,0,0,0,0,0,0,0};	    /* insert a line */
X    EXTERN char ckline[8] = {0,0,0,0,0,0,0,0};	    /* kill a line */
X    EXTERN char cundlb[8] = {0,0,0,0,0,0,0,0};	/* turn on underline */
X    EXTERN char cundle[8] = {0,0,0,0,0,0,0,0};	/* turn off underline */
X    EXTERN char cboldb[8] = {0,0,0,0,0,0,0,0};	/* start bold */
X    EXTERN char cbolde[8] = {0,0,0,0,0,0,0,0};	/* end bold */
X
X    EXTERN int ddline = 12;	/* unix really needs scroll window */
X    EXTERN int dscrl = 6;
X    EXTERN int dxcase = 0;
X#ifdef USECTRLZ
X    EXTERN int usecz = 1;
X#else
X    EXTERN int usecz = 0;
X#endif
X    EXTERN int autoin = 0;	/* TRUE if auto indent, FALSE otherwise */
X    EXTERN int logdef = 0;	/* backup log file by default 0->no, 1-> yes */
X    EXTERN char delkey = 8;
X    EXTERN int tvlins = 0;	/* number of lines on screen */
X    EXTERN int tvcols = 0;	/* number of columns on screen */
X    EXTERN int tvhardlines = 0;	/* real number of lines */
X    EXTERN int tvx = 0;        /* current x cursor position */
X    EXTERN int tvy = 0;        /* current y cursor position */
X    EXTERN int tvdlin = 0;     /* the "active" display line */
X    EXTERN int dsplin = 0;     /* the default display line */
X    EXTERN int tabspc = 8;     /* spacing for tabs */
X    EXTERN int leftmg = 0;	/* left margin of display */
X    EXTERN int wraplm = 0;	/* auto wrap? */
X    EXTERN int isibmpc = 0;	/* for possible use with a general version */
X
X    EXTERN char synofr[20] =	/* from table */
X      {' ',13,'[',']',000,000,000,000,000,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char synoto[20] =		/* translate to table */
X      {'r','d','{','{',000,0,000,00,00,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char funkey = 0;		/* leading char for function key */
X    EXTERN char funchar[50] =	/* code sent by function key */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X    EXTERN char funcmd[50] =	/* equivalent command */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X#endif
X/* ********************************************************************** */
X#ifdef VT100 
X    EXTERN int addx = 0;		/* amount to add to get x */
X    EXTERN int addy = 0;			/* to get y */
X    EXTERN char cxychr = 1;		/* true if convert xy bin to ascii */
X    EXTERN char cversn[12] = "VT-100";     /* a version to identify config */
X    EXTERN char cxy1st = 'l';			/* l if line first, c if column 1st */
X    EXTERN char cxybeg[8] = {27,'[',0,0,0,0,0,0};	/* start xy control seq  */
X    EXTERN char cxymid[8] = {';',0,0,0,0,0,0,0};  /* middle xy control seq */
X    EXTERN char cxyend[8] = {'H',0,0,0,0,0,0,0};  /* end sequence */
X    EXTERN char cerrbg[8] = {7,0,0,0,0,0,0,0}; /* string to print when errors start */
X    EXTERN char cerred[8] = {0,0,0,0,0,0,0,0};  /* when errors done */
X    EXTERN char ctopb[8] = {27,'M',0,0,0,0,0,0}; /* top blanks = reverse linefeed */
X    EXTERN char cinit[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* start up sequence */
X    EXTERN char cendit[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* to end session */
X    EXTERN char cbotb[8] = {10,0,0,0,0,0,0,0};  /* bottom blank line sequence */
X    EXTERN char celin[8] = {27,'[','K',0,0,0,0,0}; /* erase to end of line */
X    EXTERN char cescr[8] = {27,'[','J',0,0,0,0,0};	    /* erase to end of screen */
X    EXTERN char ccsrcm[8] = {0,0,0,0,0,0,0,0};	/* set cursor to command mode */
X    EXTERN char ccsrin[8] = {0,0,0,0,0,0,0,0};	/* set cursor to insert mode */
X    EXTERN char ciline[8] = {0,0,0,0,0,0,0,0};	    /* insert a line */
X    EXTERN char ckline[8] = {0,0,0,0,0,0,0,0};	    /* kill a line */
X    EXTERN char cundlb[8] = {0,0,0,0,0,0,0,0};	/* turn on underline */
X    EXTERN char cundle[8] = {0,0,0,0,0,0,0,0};	/* turn off underline */
X    EXTERN char cboldb[8] = {0,0,0,0,0,0,0,0};	/* start bold */
X    EXTERN char cbolde[8] = {0,0,0,0,0,0,0,0};	/* end bold */
X
X    EXTERN int ddline = 16;
X    EXTERN int dscrl = 0;
X    EXTERN int dxcase = 0;
X#ifdef USECTRLZ
X    EXTERN int usecz = 1;
X#else
X    EXTERN int usecz = 0;
X#endif
X    EXTERN int autoin = 0;	/* TRUE if auto indent, FALSE otherwise */
X    EXTERN int logdef = 0;	/* backup log file by default 0->no, 1-> yes */
X    EXTERN char delkey = 8;
X    EXTERN int tvlins = 24;	/* number of lines on screen */
X    EXTERN int tvcols = 80;	/* number of columns on screen */
X    EXTERN int tvhardlines = 24;	/* real number of lines */
X    EXTERN int tvx = 0;        /* current x cursor position */
X    EXTERN int tvy = 0;        /* current y cursor position */
X    EXTERN int tvdlin = 0;     /* the "active" display line */
X    EXTERN int dsplin = 0;     /* the default display line */
X    EXTERN int tabspc = 8;     /* spacing for tabs */
X    EXTERN int leftmg = 0;	/* left margin of display */
X    EXTERN int wraplm = 0;	/* auto wrap? */
X    EXTERN int isibmpc = 0;	/* for possible use with a general version */
X
X    EXTERN char synofr[20] =	/* from table */
X      {' ',13,'[',']',000,000,000,000,000,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char synoto[20] =		/* translate to table */
X      {'r','d','{','{',000,0,000,00,00,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char funkey = 0;		/* leading char for function key */
X    EXTERN char funchar[50] =	/* code sent by function key */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X    EXTERN char funcmd[50] =	/* equivalent command */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X#endif
X/* ********************************************************************** */
X#ifdef H19
X    EXTERN int addx = 31;		/* amount to add to get x */
X    EXTERN int addy = 31;			/* to get y */
X    EXTERN char cxychr = 0;		/* true if convert xy bin to ascii */
X    EXTERN char cversn[12] = "H19";     /* a version to identify config */
X    EXTERN char cxy1st = 'l';			/* l if line first, c if column 1st */
X    EXTERN char cxybeg[8] = {27,'Y',0,0,0,0,0,0};	/* start xy control seq  */
X    EXTERN char cxymid[8] = {0,0,0,0,0,0,0,0};  /* middle xy control seq */
X    EXTERN char cxyend[8] = {0,0,0,0,0,0,0,0};  /* end sequence */
X    EXTERN char cerrbg[8] = {27,'p',0,0,0,0,0,0}; /* string to print when errors start */
X    EXTERN char cerred[8] = {27,'q',0,0,0,0,0,0};  /* when errors done */
X    EXTERN char ctopb[8] = {27,'I',0,0,0,0,0,0}; /* top blanks = reverse linefeed */
X    EXTERN char cinit[20] = {27,'w',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* start up sequence */
X    EXTERN char cendit[20] = {27,'v',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* to end session */
X    EXTERN char cbotb[8] = {10,0,0,0,0,0,0,0};  /* bottom blank line sequence */
X    EXTERN char celin[8] = {27,'K',0,0,0,0,0,0};	    /* erase to end of line */
X    EXTERN char cescr[8] = {27,'J',0,0,0,0,0,0};	    /* erase to end of screen */
X    EXTERN char ccsrcm[8] = {27,'y','4',0,0,0,0,0};	/* set cursor to command mode */
X    EXTERN char ccsrin[8] = {27,'x','4',0,0,0,0,0};	/* set cursor to insert mode */
X    EXTERN char ciline[8] = {27,'L',0,0,0,0,0,0};	    /* insert a line */
X    EXTERN char ckline[8] = {27,'M',0,0,0,0,0,0};	    /* kill a line */
X    EXTERN char cundlb[8] = {27,'p',0,0,0,0,0,0};	/* turn on underline */
X    EXTERN char cundle[8] = {27,'q',0,0,0,0,0,0};	/* turn off underline */
X    EXTERN char cboldb[8] = {27,'p',0,0,0,0,0,0};	/* start bold */
X    EXTERN char cbolde[8] = {27,'q',0,0,0,0,0,0};	/* end bold */
X
X    EXTERN int ddline = 16;
X    EXTERN int dscrl = 0;
X    EXTERN int dxcase = 0;
X#ifdef USECTRLZ
X    EXTERN int usecz = 1;
X#else
X    EXTERN int usecz = 0;
X#endif
X    EXTERN int autoin = 0;	/* TRUE if auto indent, FALSE otherwise */
X    EXTERN int logdef = 0;	/* backup log file by default 0->no, 1-> yes */
X    EXTERN char delkey = 8;
X    EXTERN int tvlins = 24;	/* number of lines on screen */
X    EXTERN int tvcols = 80;	/* number of columns on screen */
X    EXTERN int tvhardlines = 24;	/* real number of lines */
X    EXTERN int tvx = 0;        /* current x cursor position */
X    EXTERN int tvy = 0;        /* current y cursor position */
X    EXTERN int tvdlin = 0;     /* the "active" display line */
X    EXTERN int dsplin = 0;     /* the default display line */
X    EXTERN int tabspc = 8;     /* spacing for tabs */
X    EXTERN int leftmg = 0;	/* left margin of display */
X    EXTERN int wraplm = 0;	/* auto wrap? */
X    EXTERN int isibmpc = 0;	/* for possible use with a general version */
X
X    EXTERN char synofr[20] =	/* from table */
X      {' ',13,'[',']',000,000,000,000,000,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char synoto[20] =		/* translate to table */
X      {'r','d','{','{',000,0,000,00,00,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char funkey = 0;		/* leading char for function key */
X    EXTERN char funchar[50] =	/* code sent by function key */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X    EXTERN char funcmd[50] =	/* equivalent command */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X#endif
X/* ********************************************************************** */
X#ifdef ATARI520
X    EXTERN int addx = 31;		/* amount to add to get x */
X    EXTERN int addy = 31;			/* to get y */
X    EXTERN char cxychr = 0;		/* true if convert xy bin to ascii */
X    EXTERN char cversn[12] = "520ST";     /* a version to identify config */
X    EXTERN char cxy1st = 'l';			/* l if line first, c if column 1st */
X    EXTERN char cxybeg[8] = {27,'Y',0,0,0,0,0,0};	/* start xy control seq  */
X    EXTERN char cxymid[8] = {0,0,0,0,0,0,0,0};  /* middle xy control seq */
X    EXTERN char cxyend[8] = {0,0,0,0,0,0,0,0};  /* end sequence */
X    EXTERN char cerrbg[8] = {27,'p',0,0,0,0,0,0}; /* string to print when errors start */
X    EXTERN char cerred[8] = {27,'q',0,0,0,0,0,0};  /* when errors done */
X    EXTERN char ctopb[8] = {27,'I',0,0,0,0,0,0}; /* top blanks = reverse linefeed */
X    EXTERN char cinit[20] = {27,'w',27,'e',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* start up sequence */
X    EXTERN char cendit[20] = {27,'v',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* to end session */
X    EXTERN char cbotb[8] = {10,0,0,0,0,0,0,0};  /* bottom blank line sequence */
X    EXTERN char celin[8] = {27,'K',0,0,0,0,0,0};	    /* erase to end of line */
X    EXTERN char cescr[8] = {27,'J',0,0,0,0,0,0};	    /* erase to end of screen */
X    EXTERN char ccsrcm[8] = {0,'y','4',0,0,0,0,0};	/* set cursor to command mode */
X    EXTERN char ccsrin[8] = {0,'x','4',0,0,0,0,0};	/* set cursor to insert mode */
X    EXTERN char ciline[8] = {27,'L',0,0,0,0,0,0};	    /* insert a line */
X    EXTERN char ckline[8] = {27,'M',0,0,0,0,0,0};	    /* kill a line */
X    EXTERN char cundlb[8] = {27,'p',0,0,0,0,0,0};	/* turn on underline */
X    EXTERN char cundle[8] = {27,'q',0,0,0,0,0,0};	/* turn off underline */
X    EXTERN char cboldb[8] = {27,'p',0,0,0,0,0,0};	/* start bold */
X    EXTERN char cbolde[8] = {27,'q',0,0,0,0,0,0};	/* end bold */
X
X    EXTERN int ddline = 16;
X    EXTERN int dscrl = 0;
X    EXTERN int dxcase = 0;
X#ifdef USECTRLZ
X    EXTERN int usecz = 1;
X#else
X    EXTERN int usecz = 0;
X#endif
X    EXTERN int autoin = 0;	/* TRUE if auto indent, FALSE otherwise */
X    EXTERN int logdef = 0;	/* backup log file by default 0->no, 1-> yes */
X    EXTERN char delkey = 8;
X    EXTERN int tvlins = 25;	/* number of lines on screen */
X    EXTERN int tvcols = 80;	/* number of columns on screen */
X    EXTERN int tvhardlines = 25;	/* real number of lines */
X    EXTERN int tvx = 0;        /* current x cursor position */
X    EXTERN int tvy = 0;        /* current y cursor position */
X    EXTERN int tvdlin = 0;     /* the "active" display line */
X    EXTERN int dsplin = 0;     /* the default display line */
X    EXTERN int tabspc = 8;     /* spacing for tabs */
X    EXTERN int leftmg = 0;	/* left margin of display */
X    EXTERN int wraplm = 0;	/* auto wrap? */
X    EXTERN int isibmpc = 0;	/* for possible use with a general version */
X
X    EXTERN char synofr[20] =	/* from table */
X      {' ',13,'[',']',000,000,000,000,000,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char synoto[20] =		/* translate to table */
X      {'r','d','{','{',000,0,000,00,00,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char funkey = 0;		/* leading char for function key */
X    EXTERN char funchar[50] =	/* code sent by function key */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X    EXTERN char funcmd[50] =	/* equivalent command */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X#endif
X/* ********************************************************************** */
X#ifdef HP2621
X    EXTERN int addx = -1;		/* amount to add to get x */
X    EXTERN int addy = -1;			/* to get y */
X    EXTERN char cxychr = 1;		/* true if convert xy bin to ascii */
X    EXTERN char cversn[12] = "HP2621x";     /* a version to identify config */
X    EXTERN char cxy1st = 'l';			/* l if line first, c if column 1st */
X    EXTERN char cxybeg[8] = {27,'&','a',0,0,0,0,0};	/* start xy control seq  */
X    EXTERN char cxymid[8] = {'y',0,0,0,0,0,0,0};  /* middle xy control seq */
X    EXTERN char cxyend[8] = {'C',0,0,0,0,0,0,0};  /* end sequence */
X    EXTERN char cerrbg[8] = {7,0,0,0,0,0,0,0}; /* string to print when errors start */
X    EXTERN char cerred[8] = {0,0,0,0,0,0,0,0};  /* when errors done */
X    EXTERN char ctopb[8] = {27,'L',0,0,0,0,0,0}; /* top blanks = reverse linefeed */
X    EXTERN char cinit[20] = {27,'&','j','@',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* start up sequence */
X    EXTERN char cendit[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
X	/* to end session */
X    EXTERN char cbotb[8] = {10,0,0,0,0,0,0,0};  /* bottom blank line sequence */
X    EXTERN char celin[8] = {27,'K',0,0,0,0,0,0};	    /* erase to end of line */
X    EXTERN char cescr[8] = {27,'J',0,0,0,0,0,0};	    /* erase to end of screen */
X    EXTERN char ccsrcm[8] = {27,'&','j','@',0,0,0,0};	/* set cursor to command mode */
X    EXTERN char ccsrin[8] = {27,'&','j','B',0,0,0,0};	/* set cursor to insert mode */
X    EXTERN char ciline[8] = {0,'L',0,0,0,0,0,0};	    /* insert a line */
X    EXTERN char ckline[8] = {27,'M',0,0,0,0,0,0};	    /* kill a line */
X    EXTERN char cundlb[8] = {0,'p',0,0,0,0,0,0};	/* turn on underline */
X    EXTERN char cundle[8] = {0,'q',0,0,0,0,0,0};	/* turn off underline */
X    EXTERN char cboldb[8] = {0,'p',0,0,0,0,0,0};	/* start bold */
X    EXTERN char cbolde[8] = {0,'q',0,0,0,0,0,0};	/* end bold */
X
X    EXTERN int ddline = 12;
X    EXTERN int dscrl = 6;
X    EXTERN int dxcase = 0;
X#ifdef USECTRLZ
X    EXTERN int usecz = 1;
X#else
X    EXTERN int usecz = 0;
X#endif
X    EXTERN int autoin = 0;	/* TRUE if auto indent, FALSE otherwise */
X    EXTERN int logdef = 0;	/* backup log file by default 0->no, 1-> yes */
X    EXTERN char delkey = 8;
X    EXTERN int tvlins = 24;	/* number of lines on screen */
X    EXTERN int tvcols = 79;	/* number of columns on screen */
X    EXTERN int tvhardlines = 24;	/* real number of lines */
X    EXTERN int tvx = 0;        /* current x cursor position */
X    EXTERN int tvy = 0;        /* current y cursor position */
X    EXTERN int tvdlin = 0;     /* the "active" display line */
X    EXTERN int dsplin = 0;     /* the default display line */
X    EXTERN int tabspc = 8;     /* spacing for tabs */
X    EXTERN int leftmg = 0;	/* left margin of display */
X    EXTERN int wraplm = 0;	/* auto wrap? */
X    EXTERN int isibmpc = 0;	/* for possible use with a general version */
X
X    EXTERN char synofr[20] =	/* from table */
X      {' ',13,'[',']',000,000,000,000,000,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char synoto[20] =		/* translate to table */
X      {'r','d','{','{',000,0,000,00,00,000,00,00,00,00,00,00,00,00,00,00};
X    EXTERN char funkey = 0;		/* leading char for function key */
X    EXTERN char funchar[50] =	/* code sent by function key */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X    EXTERN char funcmd[50] =	/* equivalent command */
X      {
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
X	000, 000, 000, 000, 000, 000, 000, 000, 000, 000
X      };
X#endif
X/* ********************************************************************** */
SHAR_EOF
echo Extracting tvx_make.bat:
sed 's/^X//' >tvx_make.bat <<\SHAR_EOF
XREM This is the batch file needed to compile and line TVX using
XREM Computer Innovations C-86 compiler.  If you have a different
XREM compiler, you will have to make your own batch file.
XREM	This batch file assumes stdio.h is in a directory called \c\.
XREM
Xcc1 tvx_1 -hc:\c\
Xcc2 tvx_1
Xcc3 tvx_1
Xcc4 tvx_1
Xcc1 tvx_2 -hc:\c\
Xcc2 tvx_2
Xcc3 tvx_2
Xcc4 tvx_2
Xcc1 tvx_lex -hc:\c\
Xcc2 tvx_lex
Xcc3 tvx_lex
Xcc4 tvx_lex
Xcc1 tvx_io -hc:\c\
Xcc2 tvx_io
Xcc3 tvx_io
Xcc4 tvx_io
Xcc1 tvx_lib -hc:\c\
Xcc2 tvx_lib
Xcc3 tvx_lib
Xcc4 tvx_lib
Xcc1 tvx_ibm -hc:\c\
Xcc2 tvx_ibm
Xcc3 tvx_ibm
Xcc4 tvx_ibm
XREM
XREM	Now, link the thing into a file called TVX.EXE
XREM	It uses the CII small, DOS 2 library, which is called /c/cslib2
XREM	on my system.  You may need to replace the library with whatever
XREM	you call the corresponding library (like c86s2s.lib).
XREM
Xlink tvx_1+tvx_2+tvx_lex+tvx_io+tvx_lib+tvx_ibm,tvx,nul:,/c/cslib2
XREM
XREM	Build the patch / configuration utilities
XREM
Xcc1 tvx_cfg -hc:\c\
Xcc2 tvx_cfg
Xcc3 tvx_cfg
Xcc4 tvx_cfg
Xlink tvx_cfg,tvx_cfg,nul:,/c/cslib2
Xcc1 tvx_ptch -hc:\c\
Xcc2 tvx_ptch
Xcc3 tvx_ptch
Xcc4 tvx_ptch
Xlink tvx_ptch,tvx_ptch,nul:,/c/cslib2
XREM
XREM	Build of tvx finished
XREM
SHAR_EOF
echo Extracting Makefile:
sed 's/^X//' >Makefile <<\SHAR_EOF
X## Makefile for tvx
XDEST	      = .
X
XEXTHDRS	      = /usr/include/ctype.h \
X		/usr/include/sgtty.h \
X		/usr/include/stdio.h \
X		/usr/include/sys/ioctl.h \
X		/usr/include/sys/types.h \
X		/usr/include/sys/stat.h \
X		/usr/include/sys/ttychars.h \
X		/usr/include/sys/ttydev.h
X
XHDRS	      = tvx_glbl.ic\
X		tvx_defs.ic
X
XLDFLAGS	      =
X
XCFLAGS        = -O
X
XLIBS	      = /usr/lib/libtermcap.a
X
XLINKER	      = cc
X
XMAKEFILE      = Makefile
X
XOBJS	      = tvx_unix.o \
X		tvx_io.o \
X		tvx_lex.o \
X		tvx_1.o \
X		tvx_2.o \
X		tvx_lib.o
X
XPRINT	      = pr
X
XPROGRAM	      = tvx
X
XSRCS	      = tvx_unix.c \
X		tvx_io.c \
X		tvx_lex.c \
X		tvx_1.c \
X		tvx_2.c \
X		tvx_lib.c
X
Xall:		$(PROGRAM)
X
X$(PROGRAM):     $(OBJS) $(LIBS)
X		@echo -n "Loading $(PROGRAM) ... "
X		@$(LINKER) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
X		@echo "done"
X
Xclean:;		@rm -f $(OBJS)
X
Xdepend:;	@mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST)
X
Xindex:;		@ctags -wx $(HDRS) $(SRCS)
X
Xinstall:	$(PROGRAM)
X		@echo Installing $(PROGRAM) in $(DEST)
X		@install -s $(PROGRAM) $(DEST)
X
Xprint:;		@$(PRINT) $(HDRS) $(SRCS)
X
Xprogram:        $(PROGRAM)
X
Xtags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
X
Xupdate:		$(DEST)/$(PROGRAM)
X
X$(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS)
X		@make -f $(MAKEFILE) DEST=$(DEST) install
X###
Xtvx_unix.o: /usr/include/ctype.h /usr/include/sys/ioctl.h \
X	/usr/include/sys/types.h /usr/include/sys/stat.h \
X	/usr/include/sys/ttychars.h /usr/include/sys/ttydev.h \
X	/usr/include/sgtty.h /usr/include/stdio.h tvx_defs.ic tvx_glbl.ic
Xtvx_io.o: /usr/include/stdio.h tvx_defs.ic tvx_glbl.ic
Xtvx_lex.o: /usr/include/stdio.h tvx_defs.ic tvx_glbl.ic
Xtvx_1.o: /usr/include/stdio.h tvx_defs.ic tvx_glbl.ic
Xtvx_2.o: /usr/include/stdio.h tvx_defs.ic tvx_glbl.ic
Xtvxlib.o: /usr/include/stdio.h tvx_defs.ic
SHAR_EOF



More information about the Comp.sources.unix mailing list