[BACK]Return to def.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Annotation of src/usr.bin/mg/def.h, Revision 1.62

1.62    ! jason       1: /*     $OpenBSD: def.h,v 1.61 2005/05/27 08:08:18 cloder Exp $ */
1.30      vincent     2:
                      3: #include <sys/queue.h>
1.6       niklas      4:
1.1       deraadt     5: /*
                      6:  * This file is the general header file for all parts
1.4       millert     7:  * of the Mg display editor. It contains all of the
1.1       deraadt     8:  * general definitions and macros. It also contains some
                      9:  * conditional compilation flags. All of the per-system and
                     10:  * per-terminal definitions are in special header files.
                     11:  */
1.58      henning    12:
1.4       millert    13: #include       "sysdef.h"      /* Order is critical.            */
1.1       deraadt    14: #include       "ttydef.h"
                     15: #include       "chrdef.h"
                     16:
                     17: #ifdef NO_MACRO
                     18: #ifndef NO_STARTUP
1.4       millert    19: #define NO_STARTUP             /* NO_MACRO implies NO_STARTUP */
1.1       deraadt    20: #endif
                     21: #endif
                     22:
1.47      vincent    23: typedef int    (*PF)(int, int);        /* generally useful type */
1.1       deraadt    24:
                     25: /*
                     26:  * Table sizes, etc.
                     27:  */
1.7       art        28: #define NFILEN 1024            /* Length, file name.            */
                     29: #define NBUFN  NFILEN          /* Length, buffer name.          */
1.4       millert    30: #define NLINE  256             /* Length, line.                 */
                     31: #define PBMODES 4              /* modes per buffer              */
                     32: #define NKBDM  256             /* Length, keyboard macro.       */
                     33: #define NPAT   80              /* Length, pattern.              */
                     34: #define HUGE   1000            /* A rather large number.        */
                     35: #define NSRCH  128             /* Undoable search commands.     */
                     36: #define NXNAME 64              /* Length, extended command.     */
1.60      db         37: #define NKNAME 20              /* Length, key names.            */
1.1       deraadt    38: /*
                     39:  * Universal.
                     40:  */
1.4       millert    41: #define FALSE  0               /* False, no, bad, etc.          */
                     42: #define TRUE   1               /* True, yes, good, etc.         */
                     43: #define ABORT  2               /* Death, ^G, abort, etc.        */
1.1       deraadt    44:
1.4       millert    45: #define KPROMPT 2              /* keyboard prompt               */
1.1       deraadt    46:
                     47: /*
                     48:  * These flag bits keep track of
                     49:  * some aspects of the last command. The CFCPCN
                     50:  * flag controls goal column setting. The CFKILL
                     51:  * flag controls the clearing versus appending
                     52:  * of data in the kill buffer.
                     53:  */
1.4       millert    54: #define CFCPCN 0x0001          /* Last command was C-P, C-N     */
                     55: #define CFKILL 0x0002          /* Last command was a kill       */
1.60      db         56: #define CFINS  0x0004          /* Last command was self-insert  */
1.1       deraadt    57:
                     58: /*
                     59:  * File I/O.
                     60:  */
1.4       millert    61: #define FIOSUC 0               /* Success.                      */
                     62: #define FIOFNF 1               /* File not found.               */
                     63: #define FIOEOF 2               /* End of file.                  */
                     64: #define FIOERR 3               /* Error.                        */
                     65: #define FIOLONG 4              /* long line partially read      */
1.1       deraadt    66:
                     67: /*
                     68:  * Directory I/O.
                     69:  */
1.4       millert    70: #define DIOSUC 0               /* Success.                      */
                     71: #define DIOEOF 1               /* End of file.                  */
                     72: #define DIOERR 2               /* Error.                        */
1.1       deraadt    73:
                     74: /*
                     75:  * Display colors.
                     76:  */
1.4       millert    77: #define CNONE  0               /* Unknown color.                */
                     78: #define CTEXT  1               /* Text color.                   */
                     79: #define CMODE  2               /* Mode line color.              */
                     80:
                     81: /*
1.22      millert    82:  * Flags for keyboard invoked functions.
1.4       millert    83:  */
                     84: #define FFUNIV         1       /* universal argument            */
1.27      deraadt    85: #define FFNEGARG       2       /* negative only argument        */
1.4       millert    86: #define FFOTHARG       4       /* other argument                */
                     87: #define FFARG          7       /* any argument                  */
                     88: #define FFRAND         8       /* Called by other function      */
1.1       deraadt    89:
                     90: /*
                     91:  * Flags for "eread".
                     92:  */
1.4       millert    93: #define EFFUNC 0x0001          /* Autocomplete functions.       */
                     94: #define EFBUF  0x0002          /* Autocomplete buffers.         */
                     95: #define EFFILE 0x0004          /* " files (maybe someday)       */
1.60      db         96: #define EFAUTO 0x0007          /* Some autocompletion on        */
1.4       millert    97: #define EFNEW  0x0008          /* New prompt.                   */
                     98: #define EFCR   0x0010          /* Echo CR at end; last read.    */
1.20      art        99: #define EFDEF  0x0020          /* buffer contains default args  */
1.1       deraadt   100:
                    101: /*
                    102:  * Flags for "ldelete"/"kinsert"
                    103:  */
                    104: #define KNONE  0
                    105: #define KFORW  1
                    106: #define KBACK  2
                    107:
1.49      vincent   108:
                    109: /*
                    110:  * This structure holds the starting position
                    111:  * (as a line/offset pair) and the number of characters in a
                    112:  * region of a buffer. This makes passing the specification
                    113:  * of a region around a little bit easier.
                    114:  */
                    115: typedef struct {
                    116:        struct LINE     *r_linep;       /* Origin LINE address.          */
1.60      db        117:        int              r_offset;      /* Origin LINE offset.           */
                    118:        RSIZE            r_size;        /* Length in characters.         */
1.49      vincent   119: } REGION;
                    120:
                    121:
1.1       deraadt   122: /*
                    123:  * All text is kept in circularly linked
                    124:  * lists of "LINE" structures. These begin at the
                    125:  * header line (which is the blank line beyond the
                    126:  * end of the buffer). This line is pointed to by
1.60      db        127:  * the "BUFFER". Each line contains the number of
1.1       deraadt   128:  * bytes in the line (the "used" size), the size
                    129:  * of the text array, and the text. The end of line
                    130:  * is not stored as a byte; it's implied. Future
                    131:  * additions will include update hints, and a
                    132:  * list of marks into the line.
                    133:  */
1.4       millert   134: typedef struct LINE {
1.60      db        135:        struct LINE     *l_fp;          /* Link to the next line         */
                    136:        struct LINE     *l_bp;          /* Link to the previous line     */
                    137:        int              l_size;        /* Allocated size                */
                    138:        int              l_used;        /* Used size                     */
                    139:        char            *l_text;        /* Content of the line           */
1.4       millert   140: } LINE;
1.1       deraadt   141:
                    142: /*
                    143:  * The rationale behind these macros is that you
                    144:  * could (with some editing, like changing the type of a line
                    145:  * link from a "LINE *" to a "REFLINE", and fixing the commands
                    146:  * like file reading that break the rules) change the actual
                    147:  * storage representation of lines to use something fancy on
                    148:  * machines with small address spaces.
                    149:  */
                    150: #define lforw(lp)      ((lp)->l_fp)
                    151: #define lback(lp)      ((lp)->l_bp)
                    152: #define lgetc(lp, n)   (CHARMASK((lp)->l_text[(n)]))
                    153: #define lputc(lp, n, c) ((lp)->l_text[(n)]=(c))
                    154: #define llength(lp)    ((lp)->l_used)
                    155: #define ltext(lp)      ((lp)->l_text)
                    156:
                    157: /*
                    158:  * All repeated structures are kept as linked lists of structures.
                    159:  * All of these start with a LIST structure (except lines, which
                    160:  * have their own abstraction). This will allow for
                    161:  * later conversion to generic list manipulation routines should
1.60      db        162:  * I decide to do that. It does mean that there are four extra
1.1       deraadt   163:  * bytes per window. I feel that this is an acceptable price,
                    164:  * considering that there are usually only one or two windows.
                    165:  */
                    166: typedef struct LIST {
                    167:        union {
1.18      mickey    168:                struct MGWIN    *l_wp;
                    169:                struct BUFFER   *x_bp;  /* l_bp is used by LINE */
                    170:                struct LIST     *l_nxt;
1.1       deraadt   171:        } l_p;
1.36      vincent   172:        const char *l_name;
1.1       deraadt   173: } LIST;
1.4       millert   174:
1.1       deraadt   175: /*
                    176:  * Usual hack - to keep from uglifying the code with lotsa
                    177:  * references through the union, we #define something for it.
                    178:  */
                    179: #define l_next l_p.l_nxt
                    180:
                    181: /*
                    182:  * There is a window structure allocated for
                    183:  * every active display window. The windows are kept in a
                    184:  * big list, in top to bottom screen order, with the listhead at
                    185:  * "wheadp". Each window contains its own values of dot and mark.
                    186:  * The flag field contains some bits that are set by commands
                    187:  * to guide redisplay; although this is a bit of a compromise in
                    188:  * terms of decoupling, the full blown redisplay is just too
                    189:  * expensive to run for every input character.
                    190:  */
1.4       millert   191: typedef struct MGWIN {
1.60      db        192:        LIST             w_list;        /* List header                  */
1.18      mickey    193:        struct BUFFER   *w_bufp;        /* Buffer displayed in window   */
                    194:        struct LINE     *w_linep;       /* Top line in the window       */
                    195:        struct LINE     *w_dotp;        /* Line containing "."          */
                    196:        struct LINE     *w_markp;       /* Line containing "mark"       */
1.60      db        197:        int              w_doto;        /* Byte offset for "."          */
                    198:        int              w_marko;       /* Byte offset for "mark"       */
                    199:        char             w_toprow;      /* Origin 0 top row of window   */
                    200:        char             w_ntrows;      /* # of rows of text in window  */
                    201:        char             w_force;       /* If NZ, forcing row.          */
                    202:        char             w_flag;        /* Flags.                       */
                    203:        LIST_HEAD(, undo_rec) w_undo;   /* Undo actions list            */
                    204:        int              w_undopos;     /* Where we were during the     */
                    205:                                         /* last undo action.           */
1.49      vincent   206:        struct undo_rec *w_undoptr;
1.54      vincent   207:        struct LINE     *w_wrapline;
1.4       millert   208: } MGWIN;
1.1       deraadt   209: #define w_wndp w_list.l_p.l_wp
                    210: #define w_name w_list.l_name
                    211:
                    212: /*
                    213:  * Window flags are set by command processors to
                    214:  * tell the display system what has happened to the buffer
                    215:  * mapped by the window. Setting "WFHARD" is always a safe thing
                    216:  * to do, but it may do more work than is necessary. Always try
                    217:  * to set the simplest action that achieves the required update.
                    218:  * Because commands set bits in the "w_flag", update will see
                    219:  * all change flags, and do the most general one.
                    220:  */
1.43      vincent   221: #define WFFORCE 0x01                   /* Force reframe.                */
                    222: #define WFMOVE 0x02                    /* Movement from line to line.   */
                    223: #define WFEDIT 0x04                    /* Editing within a line.        */
                    224: #define WFHARD 0x08                    /* Better to a full display.     */
                    225: #define WFMODE 0x10                    /* Update mode line.             */
1.1       deraadt   226:
1.35      vincent   227: struct undo_rec;
                    228:
1.1       deraadt   229: /*
                    230:  * Text is kept in buffers. A buffer header, described
                    231:  * below, exists for every buffer in the system. The buffers are
                    232:  * kept in a big list, so that commands that search for a buffer by
                    233:  * name can find the buffer header. There is a safe store for the
                    234:  * dot and mark in the header, but this is only valid if the buffer
                    235:  * is not being displayed (that is, if "b_nwnd" is 0). The text for
                    236:  * the buffer is kept in a circularly linked list of lines, with
                    237:  * a pointer to the header line in "b_linep".
                    238:  */
1.4       millert   239: typedef struct BUFFER {
1.60      db        240:        LIST             b_list;        /* buffer list pointer           */
1.18      mickey    241:        struct BUFFER   *b_altb;        /* Link to alternate buffer      */
                    242:        struct LINE     *b_dotp;        /* Link to "." LINE structure    */
                    243:        struct LINE     *b_markp;       /* ditto for mark                */
                    244:        struct LINE     *b_linep;       /* Link to the header LINE       */
                    245:        struct MAPS_S   *b_modes[PBMODES]; /* buffer modes               */
1.60      db        246:        int              b_doto;        /* Offset of "." in above LINE   */
                    247:        int              b_marko;       /* ditto for the "mark"          */
                    248:        short            b_nmodes;      /* number of non-fundamental modes */
                    249:        char             b_nwnd;        /* Count of windows on buffer    */
                    250:        char             b_flag;        /* Flags                         */
                    251:        char             b_fname[NFILEN]; /* File name                   */
                    252:        struct fileinfo  b_fi;          /* File attributes               */
1.4       millert   253: } BUFFER;
1.1       deraadt   254: #define b_bufp b_list.l_p.x_bp
                    255: #define b_bname b_list.l_name
                    256:
1.43      vincent   257: #define BFCHG  0x01                    /* Changed.                      */
                    258: #define BFBAK  0x02                    /* Need to make a backup.        */
1.1       deraadt   259: #ifdef NOTAB
1.43      vincent   260: #define BFNOTAB 0x04                   /* no tab mode                   */
1.1       deraadt   261: #endif
1.43      vincent   262: #define BFOVERWRITE 0x08               /* overwrite mode                */
1.60      db        263: #define BFREADONLY  0x10               /* read only mode                */
1.1       deraadt   264:
                    265: /*
1.30      vincent   266:  * This structure holds information about recent actions for the Undo command.
                    267:  */
                    268: struct undo_rec {
1.34      deraadt   269:        LIST_ENTRY(undo_rec) next;
1.30      vincent   270:        enum {
                    271:                INSERT = 1,
                    272:                DELETE,
                    273:                BOUNDARY
                    274:        } type;
                    275:        REGION           region;
                    276:        int              pos;
1.34      deraadt   277:        char            *content;
1.30      vincent   278: };
                    279:
                    280: /*
1.4       millert   281:  * Prototypes.
                    282:  */
                    283:
1.5       millert   284: /* tty.c X */
1.29      millert   285: void    ttinit(void);
                    286: void    ttreinit(void);
                    287: void    tttidy(void);
                    288: void    ttmove(int, int);
                    289: void    tteeol(void);
                    290: void    tteeop(void);
                    291: void    ttbeep(void);
                    292: void    ttinsl(int, int, int);
                    293: void    ttdell(int, int, int);
                    294: void    ttwindow(int, int);
                    295: void    ttnowindow(void);
                    296: void    ttcolor(int);
                    297: void    ttresize(void);
1.31      deraadt   298:
                    299: volatile sig_atomic_t winch_flag;
1.4       millert   300:
                    301: /* ttyio.c */
1.29      millert   302: void    ttopen(void);
                    303: int     ttraw(void);
                    304: void    ttclose(void);
                    305: int     ttcooked(void);
                    306: int     ttputc(int);
                    307: void    ttflush(void);
                    308: int     ttgetc(void);
                    309: int     ttwait(int);
                    310: int     typeahead(void);
1.4       millert   311:
                    312: /* dir.c */
1.29      millert   313: void    dirinit(void);
                    314: int     changedir(int, int);
                    315: int     showcwdir(int, int);
1.4       millert   316:
                    317: /* dired.c */
1.29      millert   318: int     dired(int, int);
                    319: int     d_otherwindow(int, int);
                    320: int     d_undel(int, int);
                    321: int     d_undelbak(int, int);
                    322: int     d_findfile(int, int);
                    323: int     d_ffotherwindow(int, int);
                    324: int     d_expunge(int, int);
                    325: int     d_copy(int, int);
                    326: int     d_del(int, int);
                    327: int     d_rename(int, int);
1.48      vincent   328: int     d_shell_command(int, int);
                    329: int     d_create_directory(int, int);
1.5       millert   330:
                    331: /* file.c X */
1.29      millert   332: int     fileinsert(int, int);
                    333: int     filevisit(int, int);
1.62    ! jason     334: int     filevisitalt(int, int);
1.40      vincent   335: int     filevisitro(int, int);
1.29      millert   336: int     poptofile(int, int);
                    337: BUFFER  *findbuffer(char *);
                    338: int     readin(char *);
                    339: int     insertfile(char *, char *, int);
                    340: int     filewrite(int, int);
                    341: int     filesave(int, int);
                    342: int     buffsave(BUFFER *);
                    343: int     makebkfile(int, int);
                    344: int     writeout(BUFFER *, char *);
                    345: void    upmodes(BUFFER *);
1.5       millert   346:
                    347: /* line.c X */
1.29      millert   348: LINE   *lalloc(int);
                    349: int     lrealloc(LINE *, int);
                    350: void    lfree(LINE *);
                    351: void    lchange(int);
1.54      vincent   352: int     linsert_str(const char *, int);
1.29      millert   353: int     linsert(int, int);
1.55      vincent   354: int     lnewline_at(LINE *, int);
1.29      millert   355: int     lnewline(void);
                    356: int     ldelete(RSIZE, int);
                    357: int     ldelnewline(void);
                    358: int     lreplace(RSIZE, char *, int);
                    359: void    kdelete(void);
                    360: int     kinsert(int, int);
                    361: int     kremove(int);
1.5       millert   362:
                    363: /* window.c X */
1.50      vincent   364: MGWIN  *new_window(BUFFER *);
                    365: void    free_window(MGWIN *);
1.29      millert   366: int     reposition(int, int);
                    367: int     refresh(int, int);
                    368: int     nextwind(int, int);
                    369: int     prevwind(int, int);
                    370: int     onlywind(int, int);
                    371: int     splitwind(int, int);
                    372: int     enlargewind(int, int);
                    373: int     shrinkwind(int, int);
                    374: int     delwind(int, int);
                    375: MGWIN   *wpopup(void);
1.4       millert   376:
                    377: /* buffer.c */
1.47      vincent   378: int     togglereadonly(int, int);
1.36      vincent   379: BUFFER  *bfind(const char *, int);
1.29      millert   380: int     poptobuffer(int, int);
1.57      jfb       381: int     killbuffer(BUFFER *);
                    382: int     killbuffer_cmd(int, int);
1.29      millert   383: int     savebuffers(int, int);
                    384: int     listbuffers(int, int);
                    385: int     addlinef(BUFFER *, char *, ...);
1.12      art       386: #define         addline(bp, text)      addlinef(bp, "%s", text)
1.29      millert   387: int     anycb(int);
                    388: int     bclear(BUFFER *);
                    389: int     showbuffer(BUFFER *, MGWIN *, int);
                    390: MGWIN   *popbuf(BUFFER *);
                    391: int     bufferinsert(int, int);
                    392: int     usebuffer(int, int);
                    393: int     notmodified(int, int);
                    394: int     popbuftop(BUFFER *);
1.4       millert   395:
                    396: /* display.c */
1.29      millert   397: int    vtresize(int, int, int);
                    398: void   vtinit(void);
                    399: void   vttidy(void);
                    400: void   update(void);
1.5       millert   401:
                    402: /* echo.c X */
1.29      millert   403: void    eerase(void);
1.36      vincent   404: int     eyorn(const char *);
                    405: int     eyesno(const char *);
1.29      millert   406: void    ewprintf(const char *fmt, ...);
1.56      vincent   407: char   *ereply(const char *, char *, size_t, ...);
                    408: char   *eread(const char *, char *, size_t, int, ...);
1.29      millert   409: int     getxtra(LIST *, LIST *, int, int);
                    410: void    free_file_list(LIST *);
1.4       millert   411:
                    412: /* fileio.c */
1.36      vincent   413: int     ffropen(const char *, BUFFER *);
                    414: int     ffwopen(const char *, BUFFER *);
1.29      millert   415: int     ffclose(BUFFER *);
                    416: int     ffputbuf(BUFFER *);
                    417: int     ffgetline(char *, int, int *);
1.36      vincent   418: int     fbackupfile(const char *);
                    419: char   *adjustname(const char *);
1.29      millert   420: char   *startupfile(char *);
                    421: int     copy(char *, char *);
                    422: BUFFER  *dired_(char *);
                    423: int     d_makename(LINE  *, char *, int);
                    424: LIST   *make_file_list(char *);
1.4       millert   425:
1.5       millert   426: /* kbd.c X */
1.29      millert   427: int     do_meta(int, int);
                    428: int     bsmap(int, int);
                    429: void    ungetkey(int);
                    430: int     getkey(int);
                    431: int     doin(void);
                    432: int     rescan(int, int);
                    433: int     universal_argument(int, int);
                    434: int     digit_argument(int, int);
                    435: int     negative_argument(int, int);
                    436: int     selfinsert(int, int);
                    437: int     quote(int, int);
1.4       millert   438:
                    439: /* main.c */
1.29      millert   440: int     ctrlg(int, int);
                    441: int     quit(int, int);
1.4       millert   442:
                    443: /* ttyio.c */
1.60      db        444: void    panic(char *);
1.4       millert   445:
                    446: /* cinfo.c */
1.29      millert   447: char   *keyname(char  *, size_t, int);
1.4       millert   448:
                    449: /* basic.c */
1.29      millert   450: int     gotobol(int, int);
                    451: int     backchar(int, int);
                    452: int     gotoeol(int, int);
                    453: int     forwchar(int, int);
                    454: int     gotobob(int, int);
                    455: int     gotoeob(int, int);
                    456: int     forwline(int, int);
                    457: int     backline(int, int);
                    458: void    setgoal(void);
                    459: int     getgoal(LINE *);
                    460: int     forwpage(int, int);
                    461: int     backpage(int, int);
                    462: int     forw1page(int, int);
                    463: int     back1page(int, int);
                    464: int     pagenext(int, int);
                    465: void    isetmark(void);
                    466: int     setmark(int, int);
                    467: int     swapmark(int, int);
                    468: int     gotoline(int, int);
1.5       millert   469:
                    470: /* random.c X */
1.29      millert   471: int     showcpos(int, int);
                    472: int     getcolpos(void);
                    473: int     twiddle(int, int);
                    474: int     openline(int, int);
                    475: int     newline(int, int);
                    476: int     deblank(int, int);
                    477: int     justone(int, int);
                    478: int     delwhite(int, int);
                    479: int     indent(int, int);
                    480: int     forwdel(int, int);
                    481: int     backdel(int, int);
                    482: int     killline(int, int);
                    483: int     yank(int, int);
                    484: int     space_to_tabstop(int, int);
1.5       millert   485:
                    486: /* extend.c X */
1.29      millert   487: int     insert(int, int);
                    488: int     bindtokey(int, int);
                    489: int     localbind(int, int);
                    490: int     define_key(int, int);
                    491: int     unbindtokey(int, int);
                    492: int     localunbind(int, int);
                    493: int     extend(int, int);
                    494: int     evalexpr(int, int);
                    495: int     evalbuffer(int, int);
                    496: int     evalfile(int, int);
1.36      vincent   497: int     load(const char *);
1.29      millert   498: int     excline(char *);
1.5       millert   499:
                    500: /* help.c X */
1.29      millert   501: int     desckey(int, int);
                    502: int     wallchart(int, int);
                    503: int     help_help(int, int);
                    504: int     apropos_command(int, int);
1.5       millert   505:
                    506: /* paragraph.c X */
1.29      millert   507: int     gotobop(int, int);
                    508: int     gotoeop(int, int);
                    509: int     fillpara(int, int);
                    510: int     killpara(int, int);
                    511: int     fillword(int, int);
                    512: int     setfillcol(int, int);
1.5       millert   513:
                    514: /* word.c X */
1.29      millert   515: int     backword(int, int);
                    516: int     forwword(int, int);
                    517: int     upperword(int, int);
                    518: int     lowerword(int, int);
                    519: int     capword(int, int);
                    520: int     delfword(int, int);
                    521: int     delbword(int, int);
                    522: int     inword(void);
1.5       millert   523:
                    524: /* region.c X */
1.29      millert   525: int     killregion(int, int);
                    526: int     copyregion(int, int);
                    527: int     lowerregion(int, int);
                    528: int     upperregion(int, int);
                    529: int     prefixregion(int, int);
                    530: int     setprefix(int, int);
1.30      vincent   531: int     region_get_data(REGION *, char *, int);
                    532: int     region_put_data(const char *, int);
1.5       millert   533:
                    534: /* search.c X */
1.29      millert   535: int     forwsearch(int, int);
                    536: int     backsearch(int, int);
                    537: int     searchagain(int, int);
                    538: int     forwisearch(int, int);
                    539: int     backisearch(int, int);
                    540: int     queryrepl(int, int);
                    541: int     forwsrch(void);
                    542: int     backsrch(void);
                    543: int     readpattern(char *);
1.5       millert   544:
                    545: /* spawn.c X */
1.29      millert   546: int     spawncli(int, int);
1.5       millert   547:
                    548: /* ttykbd.c X */
1.29      millert   549: void    ttykeymapinit(void);
                    550: void    ttykeymaptidy(void);
1.5       millert   551:
                    552: /* match.c X */
1.29      millert   553: int     showmatch(int, int);
1.5       millert   554:
                    555: /* version.c X */
1.29      millert   556: int     showversion(int, int);
1.5       millert   557:
                    558: #ifndef NO_MACRO
                    559: /* macro.c X */
1.29      millert   560: int     definemacro(int, int);
                    561: int     finishmacro(int, int);
                    562: int     executemacro(int, int);
1.5       millert   563: #endif /* !NO_MACRO */
                    564:
                    565: /* modes.c X */
1.29      millert   566: int     indentmode(int, int);
                    567: int     fillmode(int, int);
                    568: int     blinkparen(int, int);
1.5       millert   569: #ifdef NOTAB
1.29      millert   570: int     notabmode(int, int);
1.5       millert   571: #endif /* NOTAB */
1.29      millert   572: int     overwrite(int, int);
                    573: int     set_default_mode(int,int);
1.5       millert   574:
                    575: #ifdef REGEX
                    576: /* re_search.c X */
1.29      millert   577: int     re_forwsearch(int, int);
                    578: int     re_backsearch(int, int);
                    579: int     re_searchagain(int, int);
                    580: int     re_queryrepl(int, int);
1.61      cloder    581: int     replstr(int, int);
1.29      millert   582: int     setcasefold(int, int);
                    583: int     delmatchlines(int, int);
                    584: int     delnonmatchlines(int, int);
                    585: int     cntmatchlines(int, int);
                    586: int     cntnonmatchlines(int, int);
1.5       millert   587: #endif /* REGEX */
1.1       deraadt   588:
1.30      vincent   589: /* undo.c X */
1.35      vincent   590: void    free_undo_record(struct undo_rec *);
1.47      vincent   591: int     undo_dump(int, int);
1.30      vincent   592: int     undo_enable(int);
                    593: int     undo_add_boundary(void);
                    594: int     undo_add_insert(LINE *, int, int);
                    595: int     undo_add_delete(LINE *, int, int);
                    596: int     undo_add_change(LINE *, int, int);
1.32      vincent   597: int     undo(int, int);
1.41      vincent   598:
                    599: /* autoexec.c X */
                    600: int     auto_execute(int, int);
                    601: PF     *find_autoexec(const char *);
                    602: int     add_autoexec(const char *, const char *);
1.46      vincent   603:
                    604: /* mail.c X */
                    605: void    mail_init(void);
1.30      vincent   606:
1.1       deraadt   607: /*
                    608:  * Externals.
                    609:  */
1.5       millert   610: extern BUFFER  *bheadp;
                    611: extern BUFFER  *curbp;
                    612: extern MGWIN   *curwp;
                    613: extern MGWIN   *wheadp;
                    614: extern int      thisflag;
                    615: extern int      lastflag;
                    616: extern int      curgoal;
1.45      deraadt   617: extern int      startrow;
1.5       millert   618: extern int      epresf;
                    619: extern int      sgarbf;
                    620: extern int      mode;
                    621: extern int      nrow;
                    622: extern int      ncol;
                    623: extern int      ttrow;
                    624: extern int      ttcol;
                    625: extern int      tttop;
                    626: extern int      ttbot;
                    627: extern int      tthue;
                    628: extern int      defb_nmodes;
                    629: extern int      defb_flag;
1.17      mickey    630: extern const char cinfo[];
1.5       millert   631: extern char    *keystrings[];
1.25      vincent   632: extern char     pat[NPAT];
1.5       millert   633: #ifndef NO_DPROMPT
                    634: extern char     prompt[];
                    635: #endif /* !NO_DPROMPT */
                    636:
                    637: /*
                    638:  * Globals.
                    639:  */
                    640: int     tceeol;
                    641: int     tcinsl;
                    642: int     tcdell;