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