home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 178_01 / tvx_defs.ic < prev    next >
Text File  |  1986-01-18  |  12KB  |  286 lines

  1. /* ----------------------------->>> tvx_defs.ic <<<---------------------
  2.   TVX - A full screen editor written in C
  3.  
  4.   Revison summary:
  5.       Version
  6.     7/15/85 - Official Public Release Version
  7.     7/18/85 -  added -b (-b to -l, -b new) switch for Unix compatibility
  8.     8/22/85 -  fixed bug with setdscrl
  9.     9/20/85 -  major revision:   some minor bug fixes
  10.            added editrpt, storerpt, execrpt, spare1, spare2
  11.            major changes to file handling
  12.     9/30/85 -  of course, bugs...
  13.     10/6/85 -  I like this date.
  14.     10/18/85 - bug in autoindent with insert message
  15.     10/25/85 - 0<tab>, ^A wild to ^C because of insert problem
  16.     11/7/85 -  Atari version
  17.     11/12/85 - get find pattern added, some LASL stuff added, lex_def added
  18.            ^C back to ^A
  19.     11/15/85 - added write save buffer
  20.     11/25/85 - minor bug with auto insert ### ins mode ### + reset in main
  21.     11/26/85 - added BUFFINDEX type for atari
  22.     11/27/85 - bug in lex_default with loops
  23.     1/10/86     - small bug in memory with long file names
  24.     
  25.  
  26. *********************************************************************  */
  27.  
  28. #include <stdio.h>
  29.  
  30. #define MSDOS            /* 8086 MS-DOS */
  31.  
  32. #define NEED_MISC_DEFS /**/
  33. /* ======================================================================== */
  34. #ifdef NEED_MISC_DEFS
  35. /* following definitons are usually not defined in most stdio.h's */
  36.  
  37. #define NIL (-1)        /* nil ptr for lists */
  38. #define TRUE 1
  39. #define FALSE 0
  40. #define FAST static
  41. #define SLOW static
  42.  
  43. /* following might not be defined in some C's stdio.h, but usually are */
  44.  
  45. /* #define EOF (-1) */    /* standard end of file */
  46. /* #define EOS '\0' */    /* standard end of string */
  47. #endif
  48. /* ======================================================================== */
  49.  
  50. #define VERSION " - TVX (1/10/86) - " 
  51.  
  52. /* ======================================================================== */
  53. /* ====> Select terminal version: #define at most ONE of <================= */
  54. /*       the following symbols debending the terminal used. (except SUN)    */
  55.  
  56. #define IBMPC
  57. /* #define ATARI520 */
  58. /* #define VT100 */
  59. /* #define HP2621 */
  60. /*#define TERMCAP*/             /* Unix TERMCAP version */
  61. /* #define SUN */        /* define for SUN in addition to TERMCAP */
  62.  
  63. /* ======================================================================== */
  64. /* ==================> Select ONE operating system  <====================== */
  65.  
  66. #undef OSCPM         /* CP/M-80 */
  67. #undef GEMDOS            /* atari 520 gemdos */
  68.  
  69. /*#define UNIX  */        /* unix is a bit different! */
  70.  
  71. /* ======================================================================== */
  72. /* ========> select other options by defining appropriate symbols <======== */
  73.  
  74. #define VB /**/        /* whether or not to create backup log version */
  75.  
  76. #undef ULBD        /* supports underline, bold in ^U, ^B format */
  77.  
  78. #define STATREPEAT    /* define for Rpt: on status line (undef STATCURLINE) */
  79.  
  80. #undef STATCURLINE    /* define for Cur line on stat line (undef STATREPEAT) */
  81.  
  82.  
  83. /* ********************************************************************** */
  84. /* ********************************************************************** */
  85.  
  86. /*  Other options now selected automatically depending on above #defines  */
  87.  
  88. /* ********************************************************************** */
  89. /* ********************************************************************** */
  90.  
  91. /* ---------------- Operating System dependent defintions --------------- */
  92.  
  93. /* important note: max value for REPEATBUFS is 9!               */
  94.  
  95. /* ---------------------------------------------------------------------- */
  96. #ifdef OSCPM            /* uses Software Toolworks C/80 */
  97. #define BACKUPNAME "BACKUP.LOG"    /* backup log file name */
  98. #define BUFFLIMIT 2500        /* how much empty space to save in buffer */
  99. #define FILEREAD "rb"        /* read a file in binary */
  100. #define FILEWRITE "wb"        /* write a binary file */
  101. #define FNAMESIZE 14        /* size of file names */
  102. #define INT16 /**/        /* ints are 16 bits */
  103. #define LINELIMIT 75        /* number of spare lines to save */
  104. #define MAKE_BACKUP 1        /* 1 (true), want to make .bak file by default */
  105. #define MAXBUFF 40000        /* maximum number of total characters */
  106. #define MAXLINE 1150        /* maximum number of lines (abt. MAXBUFF/30) */
  107. #define REPEATBUFS 3        /* number of repeat buffers allowed */
  108. #define USELF /**/        /* using line feed on video */
  109. #define FILELF /**/            /* also in files */
  110. #define NEWLINE 13        /* 1st line separator: CR */
  111. #define USECTRLZ /**/
  112. #define NEEDTVLIB /**/        /* need standard c lib routines */
  113. #define BUFFINDEX unsigned int
  114. #endif
  115.  
  116. /* ---------------------------------------------------------------------- */
  117. #ifdef MSDOS
  118. #define HELP /**/        /* help available */
  119. #define FULLHELP /**/        /* all of it */
  120. #define CONFIGFILE /**/        /* allow -c switch */
  121. #define BACKUPNAME "BACKUP.LOG"    /* backup log file name */
  122. #define BUFFLIMIT 3000        /* how much empty space to save in buffer */
  123. #define FILEREAD "rb"        /* read a file in binary */
  124. #define FILEWRITE "wb"        /* write a binary file */
  125. #define FNAMESIZE 70        /* size of file names, allows paths */
  126. #define INT16 /**/        /* ints are 16 bits */
  127. #define LINELIMIT 75        /* number of spare lines to save */
  128. #define MAKE_BACKUP 1        /* 1 (true), want to make .bak file by default */
  129. #define MAXBUFF 60000        /* maximum number of total characters */
  130. #define MAXLINE 3500        /* maximum number of lines (abt. MAXBUFF/30) */
  131. #define REPEATBUFS 5        /* number of repeat buffers allowed */
  132. #define USELF /**/        /* using line feed */
  133. #define FILELF    /**/        /* also in files */
  134. #define NEWLINE 13        /* 1st line separator: CR */
  135. #define BUFFINDEX unsigned int
  136. /* #define USECTRLZ */
  137. #endif
  138. /* ---------------------------------------------------------------------- */
  139. /* ---------------------------------------------------------------------- */
  140. #ifdef GEMDOS
  141. #define HELP /**/        /* help available */
  142. #define FULLHELP /**/        /* all of it */
  143. #define CONFIGFILE /**/        /* allow -c switch */
  144. #define BACKUPNAME "BACKUP.LOG"    /* backup log file name */
  145. #define BUFFLIMIT 3000        /* how much empty space to save in buffer */
  146. #define FILEREAD "r"        /* read a file in binary */
  147. #define FILEWRITE "w"        /* write a binary file */
  148. #define fopen fopenb
  149. #define FNAMESIZE 70        /* size of file names, allows paths */
  150. #define INT16 /**/        /* ints are 16 bits */
  151. #define LINELIMIT 75        /* number of spare lines to save */
  152. #define MAKE_BACKUP 1        /* 1 (true), want to make .bak file by default */
  153. #define MAXBUFF 60000        /* maximum number of total characters */
  154. #define MAXLINE 3500        /* maximum number of lines (abt. MAXBUFF/30) */
  155. #define REPEATBUFS 5        /* number of repeat buffers allowed */
  156. #define USELF /**/        /* using line feed */
  157. #define FILELF /**/        /* also in files */
  158. #define NEWLINE 13        /* 1st line separator: CR */
  159. #define USECTRLZ /**/
  160. #define BUFFINDEX long
  161. #endif
  162. /* ---------------------------------------------------------------------- */
  163.  
  164. /* ---------------------------------------------------------------------- */
  165. #ifdef UNIX
  166. #define getchr fgetc
  167. #define FLOWCONTROL /**/    /* define this if you want ^S/^Q enabled */
  168. #undef COMMA_BAK        /* #define if you want ".," backup files */
  169. #define NO_EXTEND_CHAR        /* only allow 127 displayable chars */
  170.  
  171. #define HELP /**/        /* help available */
  172. #define FULLHELP /**/        /* all of it */
  173. #define CONFIGFILE /**/        /* allow -c switch */
  174. #define BACKUPNAME "BACKUP.LOG"    /* backup log file name */
  175. #define BUFFLIMIT 4000        /* how much empty space to save in buffer */
  176. #define FILEREAD "r"        /* read a file in binary */
  177. #define FILEWRITE "w"        /* write a binary file */
  178. #define FNAMESIZE 80        /* size of file names, allows paths */
  179. #define LINELIMIT 100        /* number of spare lines to save */
  180. #define MAKE_BACKUP 1        /* 1 (true), want to make .B file by default */
  181.         /* change to 0 if don't want, which is like other Unix eds */
  182. #define MAXBUFF 120000        /* maximum number of total characters */
  183. #define MAXLINE 5000        /* maximum number of lines (abt. MAXBUFF/30) */
  184. #define NEWLINE 10
  185. #define REPEATBUFS 9        /* number of repeat buffers allowed */
  186. #define USELF /**/        /* using line feed on screen */
  187. #define BUFFINDEX unsigned int
  188. #endif
  189. /* ---------------------------------------------------------------------- */
  190.  
  191. /* ---------------------------------------------------------------------- */
  192. /* ---------------------- Misc defintions ------------------------------- */
  193.  
  194. #define ARB 100
  195. #define ALMOSTOUT 300   /* garbage collect when ALMOSTOUT characters left */
  196. #define BACKSPACE 8
  197. #define BEGLINE (-10)  /* marks beginning of active line */
  198. #define BELL 7       /* bell */
  199. #define CR 13 
  200. #define ESC 27 
  201. #define ENDFILE 26
  202. #define ENDLINE 0  /* marks end of a line */
  203. #define GARBAGE (-14)  /* filler character for gbgcol */
  204. #define LF 10 
  205. #define NO 0
  206. #define TOGUNDERLINE 21     /* ^U for underline */
  207. #define TOGBOLD 2         /* ^B for bold */
  208. #define TAB 9
  209. #define YES 1
  210.  
  211. #define E0 0            /* element 0 of arrays (skipped) */
  212.  
  213. /* ---------------------- Wild card values ----------------------------------- */
  214. #define W_letter 12        /* ^L is letter */
  215. #define W_digit 4        /* ^D is digit */
  216. #define W_alpha 1        /* ^A is alpha num */
  217. #define W_punc 16        /* ^P is punctuation */
  218. #define W_anything 24        /* ^X is any character */
  219. #define W_others 15        /* ^O is non-alpha */
  220. #define W_user 21        /* ^U is user set */
  221. #define W_span 23        /* ^W is "word" of */
  222. #define W_skip 14        /* ^N is not in word of*/
  223. /* -------------------- Command Definitions ----------------------------- */
  224.  
  225. #define VRIGHT 1        /* lex val right, or foward one character */
  226. #define VLEFT 2         /* left or backwards one character */
  227. #define VDOWNLINE 3        /* down line, to beg. of next line */
  228. #define VUPLINE 4        /* up line, to beg. of prev. line */
  229. #define VDOWNCOL 5        /* down in column ^D */
  230. #define VUPCOL 6        /* up in column ^U */
  231. #define VDELLAST 7        /* delete previous character */
  232. #define VDELNEXT 8        /* delete forward */
  233. #define VINSERT 9        /* insert text */
  234. #define VKILLALL 10        /* kill entire current line */
  235. #define VKILLREST 11        /* kill rest of current line */
  236. #define VKILLPREV 12        /* kill previous part of line */
  237. #define VBEGLINE 13        /* beginning of current line */
  238. #define VENDLINE 14        /* back of current line */
  239. #define VSEARCH 15        /* find a string */
  240. #define VNEXT 16        /* next - search across pages */
  241. #define VFLIP 17        /* page a screen full */
  242. #define VTOP 18            /* top of buffer */
  243. #define VBOTTOM 19        /* bottom of buffer */
  244. #define VFBEGIN 20        /* beginning of file */
  245. #define VVERIFY 21        /* verify: rewrite screen or show dot */
  246. #define VOPENLINE 22        /* open a new line */
  247. #define VREMOVE 23        /* remove last thing maniuplated */
  248. #define VSAVE 24        /* put text in save buffer */
  249. #define VGET 25            /* get or restore save buffer */
  250. #define VWPAGE 26        /* write current page, fetch next page */
  251. #define VYANK 27        /* "save" from external file */
  252. #define VQUIT 28        /* quit */
  253. #define VSAGAIN 29        /* search for the thing again */
  254. #define VXREPEAT 30        /* execute repeat buffer */
  255. #define VMEMORY 31        /* print remaining buffer space */
  256. #define VSETPARS 32        /* set parameters */
  257. #define VRMVINS 33        /* remove last, enter insert mode */
  258. #define VUNKILL 34        /* unkill last line killed */
  259. #define VMVWORD 35        /* move over a word at a time */
  260. #define VMVBWORD 36        /* move over words backwards */
  261. #define VSAPPEND 37        /* append to save buffer */
  262. #define VPRINTS 38        /* print screen */
  263. #define VHELP 39        /* show contents of repeat buffer */
  264. #define VHALFP 40        /* half a page down */
  265. #define VABORT 41        /* abort */
  266. #define VCHANGE 42        /* change n chars */
  267. #define VJUMP 43        /* jump back to prev loc */
  268. #define VTIDY 44        /* tidy - justify */
  269. #define VNOTELOC 45        /* note current location */
  270. #define VRETNOTE 46        /* ^N  - Return to noted loc */
  271. #define VSYSTEM 47        /* call operating system */
  272. #define VEDITRPT 48        /* edit repeat buffer n */
  273. #define VSTORERPT 49        /* store in repeat buffer n */
  274. #define VEXECRPT 50        /* execute repeat buffer k n time */
  275. #define VINSPAT 51        /* insert search pattern */
  276. #define VUSER1 52        /* spare 1 */
  277. #define VUSER2 53        /* spare 2 */
  278.  
  279. #define SLOOPBEG '<'        /* beginning of a loop */
  280. #define SLOOPEND '>'        /* end of a loop */
  281.  
  282. #define LEXVALUES 53        /* total number of lexical values */
  283. #define UNKNOWN (-5)        /* unknown lexical value */
  284.  
  285. /* ********************************************************************* */
  286.