home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / beav1402.zip / def.h < prev    next >
Text File  |  1993-04-16  |  21KB  |  570 lines

  1. /*
  2.  *     Common header file.
  3.  *
  4.  * This file is the general header file for all parts
  5.  * of the display editor. It contains all of the
  6.  * general definitions and macros. It also contains some
  7.  * conditional compilation flags. All of the per-system and
  8.  * per-terminal definitions are in special header files.
  9.  * The most common reason to edit this file would be to zap
  10.  * the definition of CVMVAS or BACKUP.
  11.  */
  12. #define LINT_ARGS   1        /* enable lint type checking */
  13. #include        "stdio.h"
  14.  
  15. #ifdef UNIX
  16. #include        "sys/types.h"
  17. #endif /* UNIX */
  18.  
  19. #define BACKUP  1        /* Make backup file.            */
  20. #define RUNCHK  1        /* Do additional checking at run time */
  21.  
  22. #ifndef    uchar
  23. #define uchar   unsigned    char
  24. #endif
  25.  
  26. #ifndef    uint
  27. #define uint    unsigned    int
  28. #endif
  29.  
  30. #ifndef    ushort
  31. #define ushort  unsigned    short
  32. #endif
  33.  
  34. #ifndef    ulong
  35. #define ulong   unsigned    long
  36. #endif
  37.  
  38. /* these defines are reserved for handling data values from the buffer */
  39. #define     D8  uchar        /* this had better be a 8 bit quantity */
  40. #define     D16 ushort        /* this had better be a 16 bit quantity */
  41. #define     D32 ulong        /* this had better be a 32 bit quantity */
  42. #define     D64 double        /* this had better be a 64 bit quantity */
  43.  
  44. /* this define is reserved for the address of a location in the buffer */
  45. #define     A32 ulong        /* this is a 32 bit address into the buffer */
  46.  
  47. #define     bool char        /* used for boolean values      */
  48. #define     bits char        /* used for boolean bit flags   */
  49.  
  50. /* this define is reserved for the byte location in the a LINE structure */
  51. #define     LPOS uint        /* this is a 32 bit address into the buffer */
  52.  
  53. /*
  54.  *      MS-DOS system header file.
  55.  */
  56. #if    MSDOS
  57. #define LARGE   1        /* Large model.         */
  58. #endif
  59. #define PCC 1            /* "[]" won't work.     */
  60. #define GOOD    0        /* Indicate hunkydoryhood   */
  61.  
  62. /*
  63.  * Macros used by the buffer name making code.
  64.  * Start at the end of the file name, scan to the left
  65.  * until BDC1 (or BDC2, if defined) is reached. The buffer
  66.  * name starts just to the right of that location, and
  67.  * stops at end of string (or at the next BDC3 character,
  68.  * if defined). BDC2 and BDC3 are mainly for VMS.
  69.  */
  70. #define BDC1    ':'        /* Buffer names.        */
  71. #define BDC2    '/'        /* Buffer names. jam    */
  72.  
  73. #ifdef UNIX
  74. #define PATHCHR ':'
  75. #define    SEPCHAR '/'
  76. #else
  77. #define PATHCHR ';'
  78. #define    SEPCHAR 0x5c        /* this is a \ char */
  79. #endif
  80.  
  81. /*
  82. *    This enables the float mode of BEAV.   Some systems may handle
  83. *    floats in a way that is not compatible with BEAV.   BEAV was
  84. *    written on Intel machines.
  85. *
  86. *    The Intel floating point representation is;
  87. *        bit 0  - 52        significand    (53 bits)
  88. *        bit 53 - 62        biased exponent (11 bits)
  89. *        bit    63            sign
  90. *    maximum range;    10^-308 <= X <= 10^+308
  91. *    obviously, not all patterns are legal floating point numbers.
  92. *    There can be up to 16 decimal digits of significand.
  93. *    There are only 3 decimal digits of exponent (308 max).
  94. *
  95. *    BEAV uses printf to display floating point numbers so it should
  96. *    transport with minimal work.   The printf format string is
  97. *    called "MSG_116e" and is defined in text.c.   I have specified
  98. *    16 digits of precision and scientific notation.   If you need
  99. *    too many more digits of precision the displayed columns may
  100. *    overwrite each other.   This can be fixed by editing the
  101. *    format.c file.   The display format can be altered by changing
  102. *    the "float_64_fmt" data.   This is more complicated, however.
  103. *
  104. *    If it cannot be made to work, turn this off.
  105. */
  106. #define    FLOAT_DISP    1
  107.  
  108. /*
  109.  *      Digital ANSI terminal header file
  110.  */
  111. #ifdef MSDOS
  112. #define    ANSI    1        /* send ANSI escape codes */
  113. #endif
  114.  
  115. #ifdef    OS2
  116. #define NCOL    132        /* Columns.     */
  117. #else
  118. #define NCOL    80        /* Columns.     */
  119. #endif
  120.  
  121. #define NROW    24        /* default rows */
  122.  
  123. #define CUSTOMIZE        /* compile switch for extended key
  124.                                                                                 binding in extend.c           */
  125. #define COSMETIC        /* cosmetic screen stuff on
  126.                                                                                 insert off screen             */
  127. #ifdef MSDOS
  128. #define WANG_CHARACTER_SCREEN 0xf0000000L
  129. #endif
  130. /*
  131.  * Table sizes, etc.
  132.  */
  133. #define NSHASH  31        /* Symbol table hash size.      */
  134. #define NFILEN  256        /* Length, file name.           */
  135. #define NBUFN   13        /* Length, buffer name.     */
  136. #define NFILE   12          /* Length, file name.  */    /* krw */
  137. #define NKBDM   256        /* Length, keyboard macro.      */
  138. #define NMSG    512        /* Length, message buffer.      */
  139. #define NPAT    80        /* Length, pattern.             */
  140. #define HUGE    1000        /* A rather large number.       */
  141. #define NSRCH   128        /* Undoable search commands.    */
  142. #define NXNAME  64        /* Length, extended command.    */
  143. #define MAXPOS  0x7FFFFFFF    /* Maximum positive long value  */
  144. #define MIN_WIN_ROWS 3        /* Minimum number of rows in a window */
  145. /*
  146.  * This is the initial allocation for user data storage.
  147.  * It has should be in the range of 1 to less than half the size
  148.  * of an int.   The define LPOS is used to index into an array of this size.
  149.  * This is main tunable parameter for the speed of beav.
  150.  * If it is too large inserts and deletes will be slow but
  151.  * file loads will be fast and memory will be efficiently used.
  152.  * If it is too small the reverse will be true.
  153.  * This seems like a good number, but I have not tested it for performance.
  154.  */
  155. #define NLINE   0x1000        /* Length, line.      pvr  */
  156.  
  157. /*
  158.  * When memory must be reallocated this is added to the allocation
  159.  * request to allow for a little slop on areas that are being worked on.
  160.  * This should reduce the number of allocations done.
  161.  */
  162. #define NBLOCK  0x1000        /* Line block extra size        */
  163.  
  164. /*
  165.  * This is the number of bytes that are allocated for the kill buffer
  166.  * when data cannot be moved by changing the pointers.
  167.  */
  168. #define KBLOCK  0x1000        /* Kill buffer block size.  */
  169.  
  170. /*
  171.  * Universal.
  172.  */
  173. #define FALSE   0        /* False, no, bad, etc.         */
  174. #define TRUE    1        /* True, yes, good, etc.        */
  175. #define ABORT   2        /* Death, ^G, abort, etc.       */
  176.  
  177. /*
  178.  * These flag bits keep track of
  179.  * some aspects of the last command.
  180.  * The CFKILL flag controls the clearing versus appending
  181.  * of data in the kill buffer.
  182.  */
  183. #define CFKILL  0x0002        /* Last command was a kill      */
  184.  
  185. /*
  186.  * File I/O.
  187.  */
  188. #define FIOSUC  0        /* Success.                     */
  189. #define FIOFNF  1        /* File not found.              */
  190. #define FIOEOF  2        /* End of file.                 */
  191. #define FIOERR  3        /* Error.                       */
  192.  
  193. /*
  194.  * Directory I/O.
  195.  */
  196. #define DIOSUC  0        /* Success.                     */
  197. #define DIOEOF  1        /* End of file.                 */
  198. #define DIOERR  2        /* Error.                       */
  199.  
  200. /*
  201.  * Display colors.
  202.  */
  203. #define CNONE   0        /* Unknown color.               */
  204. #define CTEXT   1        /* Text color.                  */
  205. #define CMODE   2        /* Mode line color.             */
  206.  
  207. /*
  208.  * Flags for "eread".
  209.  */
  210. #define EFNEW   0x0001        /* New prompt.                  */
  211. #define EFAUTO  0x0002        /* Autocompletion enabled.      */
  212. #define EFCR    0x0004        /* Echo CR at end; last read.   */
  213.  
  214. /*
  215.  * Keys are represented inside using an 12 bit
  216.  * keyboard code. The transformation between the keys on
  217.  * the keyboard and 12 bit code is done by terminal specific
  218.  * code in the "kbd.c" file. The actual character is stored
  219.  * in 8 bits (DEC multinationals work); there is also a control
  220.  * flag KCTRL, a meta flag KMETA, and a control-X flag KCTLX.
  221.  * ASCII control characters are always represented using the
  222.  * KCTRL form. Although the C0 control set is free, it is
  223.  * reserved for C0 controls because it makes the communication
  224.  * between "getkey" and "getkbd" easier. The funny keys get
  225.  * mapped into the C1 control area.
  226.  */
  227. #define NKEYS   4096        /* 12 bit code.                 */
  228.  
  229. #define METACH  0x1B        /* M- prefix,   Control-[, ESC  */
  230. #define CTMECH  0x1C        /* C-M- prefix, Control-\       */
  231. #define EXITCH  0x1D        /* Exit level,  Control-]       */
  232. #define CTRLCH  0x1E        /* C- prefix,   Control-^       */
  233. #define HELPCH  0x1F        /* Help key,    Control-_       */
  234. #define CTL_G   0x07        /* Abort command key            */
  235.  
  236. #define KCHAR   0x00FF        /* The basic character code.    */
  237. #define KCTRL   0x0100        /* Control flag.                */
  238. #define KMETA   0x0200        /* Meta flag.                   */
  239. #define KCTLX   0x0400        /* Control-X flag.              */
  240.  
  241. #define KFIRST  0x0800        /* First special.       fitz    */
  242. #define KLAST   0x0873        /* Last special.                */
  243.  
  244. #define KRANDOM 0x0080        /* A "no key" code.             */
  245.  
  246. /*
  247. *    This causes the key sequence ESC [ <key> to be delevered as
  248. *    KCTRL | KMETA | KCTLX | <key>.   This allows VT100 function keys
  249. *    to be bound.
  250. */
  251. #define    VT100KEY
  252.  
  253. /*
  254.  *    These define the column used in the help (wallchart) function
  255.  */
  256. #define    HFUNCCOL    3
  257. #define    HKEY        32
  258. #define    HKEYCODE    50
  259. #define    HENDCOL     55
  260.  
  261. /*
  262.  * These flags, and the macros below them,
  263.  * make up a do-it-yourself set of "ctype" macros that
  264.  * understand the DEC multinational set, and let me ask
  265.  * a slightly different set of questions.
  266.  */
  267. #define _W      0x01        /* Word.                        */
  268. #define _U      0x02        /* Upper case letter.           */
  269. #define _L      0x04        /* Lower case letter.           */
  270. #define _C      0x08        /* Control.                     */
  271.  
  272. #define ISCTRL(c)       ((cinfo[(c)]&_C)!=0)
  273. #define ISUPPER(c)      ((cinfo[(c)]&_U)!=0)
  274. #define ISLOWER(c)      ((cinfo[(c)]&_L)!=0)
  275. #define TOUPPER(c)      ((c)-0x20)
  276. #define TOLOWER(c)      ((c)+0x20)
  277.  
  278. #define BUF_SIZE(wp)    (wp -> w_bufp -> b_linep -> l_bp -> l_file_offset + \
  279.                         wp -> w_bufp -> b_linep -> l_bp -> l_used)
  280. #define BUF_START(wp)   (wp -> w_bufp -> b_linep -> l_fp -> l_file_offset)
  281. #define DOT_POS(wp)     (wp -> w_dotp -> l_file_offset + wp -> w_doto)
  282. #define MARK_POS(wp)    (wp -> w_markp -> l_file_offset + wp -> w_marko)
  283. #define DOT_CHAR(wp)    (wp -> w_dotp -> l_text[wp -> w_doto])
  284. #define WIND_POS(wp)    (wp -> w_linep -> l_file_offset + wp -> w_loff)
  285. #define R_TYPE(wp)      (wp -> w_fmt_ptr -> r_type)
  286. #define R_SIZE(wp)      (wp -> w_fmt_ptr -> r_size)
  287. #define R_UNITS(wp)     (wp -> w_fmt_ptr -> r_units)
  288. #define R_BYTES(wp)     (wp -> w_fmt_ptr -> r_bytes)
  289. #define R_ALIGN(wp)     (wp -> w_fmt_ptr -> r_align)
  290. #define R_B_PER_U(wp)   (wp -> w_fmt_ptr -> r_b_per_u)
  291. #define R_CHR_PER_U(wp) (wp -> w_fmt_ptr -> r_chr_per_u)
  292. #define R_FLAGS(wp)     (wp -> w_fmt_ptr -> r_flags)
  293. #define R_UNIT_FMT(wp)  (wp -> w_fmt_ptr -> r_unit_fmt)
  294. #define R_POS_FMT(wp)    (wp -> w_fmt_ptr -> r_pos_fmt)
  295. #define R_BYTE_FMT(wp)    (wp -> w_fmt_ptr -> r_byte_fmt)
  296. #define R_POSITIONS(wp) (wp -> w_fmt_ptr -> r_positions)
  297.  
  298. /*
  299.  * The symbol table links editing functions
  300.  * to names. Entries in the key map point at the symbol
  301.  * table entry. A reference count is kept, but it is
  302.  * probably next to useless right now. The old type code,
  303.  * which was not being used and probably not right
  304.  * anyway, is all gone.
  305.  */
  306. typedef struct SYMBOL
  307. {
  308.     struct SYMBOL *s_symp;    /* Hash chain.                  */
  309.     short s_nkey;        /* Count of keys bound here.    */
  310.     char *s_name;        /* Name.            */
  311.          bool (*s_funcp) ();    /* Function.                    */
  312.     bits s_modify;        /* modify bit */
  313. } SYMBOL;
  314.  
  315. /*
  316. *   These are the legal values for 's_modify' and 'k_modify'
  317. */
  318. #define SMOD    0x01        /* command modifies the buffer  */
  319. #define SSIZE   0x02        /* command changes buffer size  */
  320. #define SSRCH   0x04        /* command valid in search  */
  321. #define SRPLC   0x08        /* command valid in replace */
  322. #define SBOUND  0x10        /* key was bound by user or rc file */
  323.  
  324. /*
  325.  * There is a window structure allocated for
  326.  * every active display window. The windows are kept in a
  327.  * big list, in top to bottom screen order, with the listhead at
  328.  * "wheadp". Each window contains its own values of dot and mark.
  329.  * The flag field contains some bits that are set by commands
  330.  * to guide redisplay; although this is a bit of a compromise in
  331.  * terms of decoupling, the full blown redisplay is just too
  332.  * expensive to run for every input character.
  333.  */
  334. typedef struct WINDOW
  335. {
  336.     struct WINDOW *w_wndp;    /* Next window                  */
  337.     struct BUFFER *w_bufp;    /* Buffer displayed in window   */
  338.     struct LINE *w_linep;    /* Top line in the window       */
  339.     LPOS w_loff;        /* Offset into line for start pvr  */
  340.     A32 w_wind_temp;        /* temp storage for window file pos */
  341.     struct LINE *w_dotp;    /* Line containing "."          */
  342.     LPOS w_doto;        /* Offset into line for "." */
  343.     A32 w_dot_temp;        /* temp storage for dot file pos */
  344.     struct LINE *w_markp;    /* Line containing "mark"       */
  345.     LPOS w_marko;        /* Byte offset for "mark"       */
  346.     A32 w_mark_temp;        /* temp storage for mark file pos */
  347.     char w_unit_offset;        /* Byte offset for "." into unit pvr */
  348.     char w_toprow;        /* Origin 0 top row of window   */
  349.     char w_ntrows;        /* # of rows of text in window  */
  350.     bits w_flag;        /* Flags.                       */
  351.     char w_disp_shift;        /* Display byte shift; 0-3  pvr */
  352.     bool w_intel_mode;        /* Display byte swaped.     pvr */
  353.     struct ROW_FMT *w_fmt_ptr;    /* Pointer to display format pvr */
  354. } WINDOW;
  355.  
  356. /*
  357.  * Window flags are set by command processors to
  358.  * tell the display system what has happened to the buffer
  359.  * mapped by the window. Setting "WFHARD" is always a safe thing
  360.  * to do, but it may do more work than is necessary. Always try
  361.  * to set the simplest action that achieves the required update.
  362.  * Because commands set bits in the "w_flag", update will see
  363.  * all change flags, and do the most general one.
  364.  */
  365. #define WFFORCE 0x01        /* Force reframe.               */
  366. #define WFMOVE  0x02        /* Movement from line to line.  */
  367. #define WFEDIT  0x04        /* Editing within a line.       */
  368. #define WFHARD  0x08        /* Better to a full display.    */
  369. #define WFMODE  0x10        /* Update mode line.        */
  370. /*
  371. *   This structure contains how a row is constructed.   pvr
  372. */
  373.  
  374. typedef struct ROW_FMT
  375. {
  376.     uchar r_type;        /* format type nibbles          */
  377.     uchar r_size;        /* format size: must be 0,1,3,7,15, etc */
  378.     uchar r_units;        /* number of units per window row: must be 1,2,4,8,16*/
  379.     uchar r_bytes;        /* number of bytes per window row: must be 1,2,4,8,16*/
  380.     uchar r_align;        /* number of bytes per align row: must be 1,2,4,8,16*/
  381.     uchar r_b_per_u;        /* number of bytes per unit: must be 1,2,4,8,16 */
  382.     uchar r_chr_per_u;        /* displayed chars per unit     */
  383.     bits r_flags;        /* flags controlling format     */
  384.     char *r_unit_fmt;        /* print format for unit */
  385.     char *r_pos_fmt;        /* print format for buffer position, always a long */
  386.     char *r_byte_fmt;        /* print format for bytes */
  387.     uchar *r_positions;        /* list of unit positions   */
  388.     struct ROW_FMT *r_srch_fmt;    /* pointer to search display format */
  389. } ROW_FMT;
  390.  
  391. /* legal values for 'r_size'  (values significant; used as bit mask) pvr */
  392.  
  393. #define BYTES   0x00        /* Display as byte; 8 bits  */
  394. #define WORDS   0x01        /* Display as word; 16 bits  */
  395. #define DWORDS  0x03        /* Display as long; 32 bits  */
  396. #define DOUBLES 0x07        /* Display as doubles; 64 bits  */
  397.  
  398. /* legal values for 'r_type'   pvr */
  399. #define ASCII   0x10        /* Display as ascii     */
  400. #define OCTAL   0x20        /* Display as octal values  */
  401. #define DECIMAL 0x30        /* Display as decimal values    */
  402. #define HEX     0x40        /* Display as hex values    */
  403. #define BINARY  0x50        /* Display as binary values */
  404. #define EBCDIC  0x60        /* Display as ebcdic        */
  405. #define TEXT    0x70        /* Display as normal text   */
  406. #if    FLOAT_DISP
  407. #define FLOAT   0x80        /* Display as floating point number */
  408. #endif
  409. /*
  410.  * Text is kept in buffers. A buffer header, described
  411.  * below, exists for every buffer in the system. The buffers are
  412.  * kept in a big list, so that commands that search for a buffer by
  413.  * name can find the buffer header. There is a safe store for the
  414.  * dot and mark in the header, but this is only valid if the buffer
  415.  * is not being displayed (that is, if "b_nwnd" is 0). The text for
  416.  * the buffer is kept in a circularly linked list of lines, with
  417.  * a pointer to the header line in "b_linep".
  418.  */
  419. typedef struct BUFFER
  420. {
  421.     bits b_type;        /* Type of buffer       */
  422.     struct BUFFER *b_bufp;    /* Link to next BUFFER          */
  423.     struct LINE *b_dotp;    /* Link to "." LINE structure   */
  424.     LPOS b_doto;        /* Offset of "." in above LINE  */
  425.     char b_unit_offset;        /* Offset into unit for "." pvr */
  426.     struct LINE *b_markp;    /* The same as the above two,   */
  427.     LPOS b_marko;        /* but for the "mark"       */
  428.     struct LINE *b_linep;    /* Link to the header LINE      */
  429.     char b_nwnd;        /* Count of windows on buffer   */
  430.     bits b_flag;        /* Flags            */
  431.     A32 b_begin_addr;        /* File address of begining of buffer */
  432.     A32 b_end_addr;        /* File address of end of buffer */
  433.     A32 b_file_size;        /* Size of file */
  434.     char b_fname[NFILEN];    /* File name                    */
  435.     char b_bname[NBUFN];    /* Buffer name                  */
  436. } BUFFER;
  437.  
  438. /* Values for 'buf_type' */
  439. #define BTFILE   0x00        /* Buffer contains a file   */
  440. #define BTDISK   0x01        /* Buffer points to a disk  */
  441. #define BTMEMORY 0x02        /* Buffer points to memory  */
  442. #define BTSAVE   0x03        /* This is the save buffer */
  443. #define BTLIST   0x04        /* This is the buffer list */
  444. #define BTHELP   0x05        /* This is the help buffer */
  445.  
  446. /* Values for 'b_flag' */
  447.  
  448. #define BFCHG   0x01        /* Changed.         */
  449. #define BFBAK   0x02        /* Need to make a backup.       */
  450. #define BFBAD   0x04        /* may be trashed alloc error?  */
  451. #define BFINMEM 0x08        /* File is entirely in memory */
  452. #define BFVIEW  0x10        /* read only (jam)               */
  453. #define BFLINK  0x20        /* Linked mode    pvr        */
  454. #define BFSLOCK 0x40        /* Lock buffer size   pvr    */
  455. /*
  456.  * This structure holds the starting position
  457.  * (as a line/offset pair) and the number of characters in a
  458.  * region of a buffer. This makes passing the specification
  459.  * of a region around a little bit easier.
  460.  * There have been some complaints that the short in this
  461.  * structure is wrong; that a long would be more appropriate.
  462.  * I'll await more comments from the folks with the little
  463.  * machines; I have a VAX, and everything fits.
  464.  */
  465. typedef struct reg
  466. {
  467.     struct LINE *r_linep;    /* Origin LINE address.         */
  468.     LPOS r_offset;        /* Origin LINE offset.          */
  469.     A32 r_size;            /* Length in characters.        */
  470. } REGION;
  471.  
  472. /*
  473.  * All text is kept in circularly linked
  474.  * lists of "LINE" structures. These begin at the
  475.  * header line (which is the blank line beyond the
  476.  * end of the buffer). This line is pointed to by
  477.  * the "BUFFER". Each line contains a the number of
  478.  * bytes in the line (the "used" size), the size
  479.  * of the text array, and the text. The end of line
  480.  * is not stored as a byte; it's implied. Future
  481.  * additions will include update hints, and a
  482.  * list of marks into the line.
  483.  */
  484. typedef struct LINE
  485. {
  486.     struct LINE *l_fp;        /* Link to the next line        */
  487.     struct LINE *l_bp;        /* Link to the previous line    */
  488.     A32 l_file_offset;        /* Offset from begining of file pvr */
  489.     LPOS l_size;        /* Allocated size           */
  490.     LPOS l_used;        /* Used size            */
  491. #if     PCC
  492.     D8 l_text[1];        /* A bunch of characters.       */
  493. #else
  494.     D8 l_text[];        /* A bunch of characters.       */
  495. #endif
  496. } LINE;
  497.  
  498. /*
  499.  * The rationale behind these macros is that you
  500.  * could (with some editing, like changing the type of a line
  501.  * link from a "LINE *" to a "REFLINE", and fixing the commands
  502.  * like file reading that break the rules) change the actual
  503.  * storage representation of lines to use something fancy on
  504.  * machines with small address spaces.
  505.  */
  506. #define lforw(lp)       ((lp)->l_fp)
  507. #define lback(lp)       ((lp)->l_bp)
  508. #define lgetc(lp, n)    ((lp)->l_text[(n)]&0xFF)
  509. #define lputc(lp, n, c) ((lp)->l_text[(n)]=(c))
  510. #define llength(lp)     ((lp)->l_used)
  511.  
  512. /*
  513.  * Externals.
  514.  */
  515. extern int thisflag;
  516. extern int lastflag;
  517. extern int curgoal;
  518. extern int epresf;
  519. extern int sgarbf;
  520. extern WINDOW *curwp;
  521. extern BUFFER *curbp;
  522. extern WINDOW *wheadp;
  523. extern BUFFER *bheadp;
  524. extern BUFFER *blistp;
  525. extern short kbdm[];
  526. extern short *kbdmip;
  527. extern short *kbdmop;
  528. extern SYMBOL *symbol[];
  529. extern SYMBOL *binding[];
  530. extern BUFFER *bfind ();
  531. extern BUFFER *bcreate ();
  532. extern WINDOW *wpopup ();
  533. extern LINE *lalloc ();
  534. extern int nrow;
  535. extern int ncol;
  536. extern char version[];
  537. extern int ttrow;
  538. extern int ttcol;
  539. extern int tceeol;
  540. extern int tcinsl;
  541. extern int tcdell;
  542. extern char cinfo[];
  543. extern SYMBOL *symlookup ();
  544. extern int nmsg;
  545. extern int curmsgf;
  546. extern int newmsgf;
  547. extern char msg[];
  548.  
  549. /* jam
  550.  */
  551. extern char *okmsg;
  552. extern int insert_mode;
  553. extern int extend_buf;
  554. extern int flush_num;
  555. extern int auto_update;
  556. extern int flush_count;
  557. extern int rowb;
  558. extern char file_off_bad;
  559.  
  560. /*
  561.  * Standard I/O.
  562.  */
  563. extern char *malloc ();
  564. extern char *strcpy ();
  565. extern char *strcat ();
  566.  
  567. #ifndef NOPROTO
  568. #include "prototyp.h"
  569. #endif /* NOPROTO */
  570.