[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.71

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