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

1.146   ! bcallah     1: /*     $OpenBSD: def.h,v 1.145 2015/03/25 20:53:31 bcallah Exp $       */
1.64      kjell       2:
                      3: /* This file is in the public domain. */
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.143     bcallah    13: #include       "chrdef.h"
1.1       deraadt    14:
1.47      vincent    15: typedef int    (*PF)(int, int);        /* generally useful type */
1.1       deraadt    16:
                     17: /*
                     18:  * Table sizes, etc.
                     19:  */
1.7       art        20: #define NFILEN 1024            /* Length, file name.            */
                     21: #define NBUFN  NFILEN          /* Length, buffer name.          */
1.4       millert    22: #define NLINE  256             /* Length, line.                 */
                     23: #define PBMODES 4              /* modes per buffer              */
                     24: #define NKBDM  256             /* Length, keyboard macro.       */
                     25: #define NPAT   80              /* Length, pattern.              */
                     26: #define HUGE   1000            /* A rather large number.        */
                     27: #define NSRCH  128             /* Undoable search commands.     */
                     28: #define NXNAME 64              /* Length, extended command.     */
1.60      db         29: #define NKNAME 20              /* Length, key names.            */
1.68      kjell      30: #define NTIME  50              /* Length, timestamp string.     */
1.1       deraadt    31: /*
                     32:  * Universal.
                     33:  */
1.4       millert    34: #define FALSE  0               /* False, no, bad, etc.          */
                     35: #define TRUE   1               /* True, yes, good, etc.         */
                     36: #define ABORT  2               /* Death, ^G, abort, etc.        */
1.125     lum        37: #define UERROR 3               /* User Error.                   */
1.127     florian    38: #define REVERT 4               /* Revert the buffer             */
1.1       deraadt    39:
1.98      deraadt    40: #define KCLEAR 2               /* clear echo area               */
1.1       deraadt    41:
                     42: /*
                     43:  * These flag bits keep track of
                     44:  * some aspects of the last command. The CFCPCN
                     45:  * flag controls goal column setting. The CFKILL
                     46:  * flag controls the clearing versus appending
                     47:  * of data in the kill buffer.
                     48:  */
1.4       millert    49: #define CFCPCN 0x0001          /* Last command was C-P, C-N     */
                     50: #define CFKILL 0x0002          /* Last command was a kill       */
1.60      db         51: #define CFINS  0x0004          /* Last command was self-insert  */
1.1       deraadt    52:
                     53: /*
                     54:  * File I/O.
                     55:  */
1.4       millert    56: #define FIOSUC 0               /* Success.                      */
                     57: #define FIOFNF 1               /* File not found.               */
                     58: #define FIOEOF 2               /* End of file.                  */
                     59: #define FIOERR 3               /* Error.                        */
                     60: #define FIOLONG 4              /* long line partially read      */
1.77      deraadt    61: #define FIODIR 5               /* File is a directory           */
1.1       deraadt    62:
                     63: /*
                     64:  * Directory I/O.
                     65:  */
1.4       millert    66: #define DIOSUC 0               /* Success.                      */
                     67: #define DIOEOF 1               /* End of file.                  */
                     68: #define DIOERR 2               /* Error.                        */
1.1       deraadt    69:
                     70: /*
                     71:  * Display colors.
                     72:  */
1.4       millert    73: #define CNONE  0               /* Unknown color.                */
                     74: #define CTEXT  1               /* Text color.                   */
                     75: #define CMODE  2               /* Mode line color.              */
                     76:
                     77: /*
1.22      millert    78:  * Flags for keyboard invoked functions.
1.4       millert    79:  */
                     80: #define FFUNIV         1       /* universal argument            */
1.27      deraadt    81: #define FFNEGARG       2       /* negative only argument        */
1.4       millert    82: #define FFOTHARG       4       /* other argument                */
                     83: #define FFARG          7       /* any argument                  */
                     84: #define FFRAND         8       /* Called by other function      */
1.1       deraadt    85:
                     86: /*
                     87:  * Flags for "eread".
                     88:  */
1.4       millert    89: #define EFFUNC 0x0001          /* Autocomplete functions.       */
                     90: #define EFBUF  0x0002          /* Autocomplete buffers.         */
                     91: #define EFFILE 0x0004          /* " files (maybe someday)       */
1.60      db         92: #define EFAUTO 0x0007          /* Some autocompletion on        */
1.4       millert    93: #define EFNEW  0x0008          /* New prompt.                   */
                     94: #define EFCR   0x0010          /* Echo CR at end; last read.    */
1.20      art        95: #define EFDEF  0x0020          /* buffer contains default args  */
1.63      kjell      96: #define EFNUL  0x0040          /* Null Minibuffer OK            */
1.1       deraadt    97:
                     98: /*
1.75      kjell      99:  * Direction of insert into kill ring
1.1       deraadt   100:  */
1.112     kjell     101: #define KNONE  0x00
                    102: #define KFORW  0x01            /* forward insert into kill ring */
                    103: #define KBACK  0x02            /* Backwards insert into kill ring */
                    104: #define KREG   0x04            /* This is a region-based kill */
1.1       deraadt   105:
1.123     lum       106: #define MAX_TOKEN 64
                    107:
1.49      vincent   108: /*
1.143     bcallah   109:  * Previously from sysdef.h
                    110:  */
                    111: typedef int    RSIZE;          /* Type for file/region sizes    */
                    112: typedef short  KCHAR;          /* Type for internal keystrokes  */
                    113:
                    114: /*
1.49      vincent   115:  * This structure holds the starting position
                    116:  * (as a line/offset pair) and the number of characters in a
                    117:  * region of a buffer. This makes passing the specification
                    118:  * of a region around a little bit easier.
                    119:  */
1.74      deraadt   120: struct region {
                    121:        struct line     *r_linep;       /* Origin line address.          */
                    122:        int              r_offset;      /* Origin line offset.           */
1.110     kjell     123:        int              r_lineno;      /* Origin line number            */
1.60      db        124:        RSIZE            r_size;        /* Length in characters.         */
1.74      deraadt   125: };
1.49      vincent   126:
                    127:
1.1       deraadt   128: /*
                    129:  * All text is kept in circularly linked
1.75      kjell     130:  * lists of "line" structures. These begin at the
1.1       deraadt   131:  * header line (which is the blank line beyond the
                    132:  * end of the buffer). This line is pointed to by
1.75      kjell     133:  * the "buffer" structure. Each line contains the number of
1.1       deraadt   134:  * bytes in the line (the "used" size), the size
                    135:  * of the text array, and the text. The end of line
                    136:  * is not stored as a byte; it's implied. Future
                    137:  * additions will include update hints, and a
                    138:  * list of marks into the line.
                    139:  */
1.74      deraadt   140: struct line {
                    141:        struct line     *l_fp;          /* Link to the next line         */
                    142:        struct line     *l_bp;          /* Link to the previous line     */
1.60      db        143:        int              l_size;        /* Allocated size                */
                    144:        int              l_used;        /* Used size                     */
                    145:        char            *l_text;        /* Content of the line           */
1.74      deraadt   146: };
1.1       deraadt   147:
                    148: /*
                    149:  * The rationale behind these macros is that you
                    150:  * could (with some editing, like changing the type of a line
1.75      kjell     151:  * link from a "struct line *" to a "REFLINE", and fixing the commands
1.1       deraadt   152:  * like file reading that break the rules) change the actual
                    153:  * storage representation of lines to use something fancy on
                    154:  * machines with small address spaces.
                    155:  */
                    156: #define lforw(lp)      ((lp)->l_fp)
                    157: #define lback(lp)      ((lp)->l_bp)
                    158: #define lgetc(lp, n)   (CHARMASK((lp)->l_text[(n)]))
                    159: #define lputc(lp, n, c) ((lp)->l_text[(n)]=(c))
                    160: #define llength(lp)    ((lp)->l_used)
                    161: #define ltext(lp)      ((lp)->l_text)
                    162:
                    163: /*
                    164:  * All repeated structures are kept as linked lists of structures.
                    165:  * All of these start with a LIST structure (except lines, which
                    166:  * have their own abstraction). This will allow for
                    167:  * later conversion to generic list manipulation routines should
1.60      db        168:  * I decide to do that. It does mean that there are four extra
1.1       deraadt   169:  * bytes per window. I feel that this is an acceptable price,
                    170:  * considering that there are usually only one or two windows.
                    171:  */
1.74      deraadt   172: struct list {
1.1       deraadt   173:        union {
1.74      deraadt   174:                struct mgwin    *l_wp;
1.75      kjell     175:                struct buffer   *x_bp;  /* l_bp is used by struct line */
1.74      deraadt   176:                struct list     *l_nxt;
1.1       deraadt   177:        } l_p;
1.82      kjell     178:        char *l_name;
1.74      deraadt   179: };
1.4       millert   180:
1.1       deraadt   181: /*
                    182:  * Usual hack - to keep from uglifying the code with lotsa
                    183:  * references through the union, we #define something for it.
                    184:  */
                    185: #define l_next l_p.l_nxt
                    186:
                    187: /*
                    188:  * There is a window structure allocated for
                    189:  * every active display window. The windows are kept in a
                    190:  * big list, in top to bottom screen order, with the listhead at
                    191:  * "wheadp". Each window contains its own values of dot and mark.
                    192:  * The flag field contains some bits that are set by commands
                    193:  * to guide redisplay; although this is a bit of a compromise in
                    194:  * terms of decoupling, the full blown redisplay is just too
                    195:  * expensive to run for every input character.
                    196:  */
1.74      deraadt   197: struct mgwin {
                    198:        struct list      w_list;        /* List header                  */
                    199:        struct buffer   *w_bufp;        /* Buffer displayed in window   */
                    200:        struct line     *w_linep;       /* Top line in the window       */
                    201:        struct line     *w_dotp;        /* Line containing "."          */
                    202:        struct line     *w_markp;       /* Line containing "mark"       */
1.60      db        203:        int              w_doto;        /* Byte offset for "."          */
                    204:        int              w_marko;       /* Byte offset for "mark"       */
1.122     lum       205:        int              w_toprow;      /* Origin 0 top row of window   */
                    206:        int              w_ntrows;      /* # of rows of text in window  */
                    207:        int              w_frame;       /* #lines to reframe by.        */
1.111     kjell     208:        char             w_rflag;       /* Redisplay Flags.             */
                    209:        char             w_flag;        /* Flags.                       */
1.74      deraadt   210:        struct line     *w_wrapline;
1.92      kjell     211:        int              w_dotline;     /* current line number of dot   */
                    212:        int              w_markline;    /* current line number of mark  */
1.74      deraadt   213: };
1.1       deraadt   214: #define w_wndp w_list.l_p.l_wp
                    215: #define w_name w_list.l_name
                    216:
                    217: /*
1.109     kjell     218:  * Window redisplay flags are set by command processors to
1.1       deraadt   219:  * tell the display system what has happened to the buffer
1.99      deanna    220:  * mapped by the window. Setting "WFFULL" is always a safe thing
1.1       deraadt   221:  * to do, but it may do more work than is necessary. Always try
                    222:  * to set the simplest action that achieves the required update.
                    223:  * Because commands set bits in the "w_flag", update will see
                    224:  * all change flags, and do the most general one.
                    225:  */
1.89      kjell     226: #define WFFRAME 0x01                   /* Force reframe.                */
1.43      vincent   227: #define WFMOVE 0x02                    /* Movement from line to line.   */
                    228: #define WFEDIT 0x04                    /* Editing within a line.        */
1.89      kjell     229: #define WFFULL 0x08                    /* Do a full display.            */
1.43      vincent   230: #define WFMODE 0x10                    /* Update mode line.             */
1.1       deraadt   231:
1.111     kjell     232: /*
                    233:  * Window flags
                    234:  */
                    235: #define WNONE  0x00                    /* No special window options.   */
                    236: #define WEPHEM 0x01                    /* Window is ephemeral.         */
                    237:
1.35      vincent   238: struct undo_rec;
1.113     oga       239: TAILQ_HEAD(undoq, undo_rec);
1.143     bcallah   240:
                    241: /*
                    242:  * Previously from sysdef.h
                    243:  * Only used in struct buffer.
                    244:  */
                    245: struct fileinfo {
                    246:         uid_t           fi_uid;
                    247:         gid_t           fi_gid;
                    248:         mode_t          fi_mode;
                    249:         struct timespec fi_mtime;       /* Last modified time */
                    250: };
1.35      vincent   251:
1.1       deraadt   252: /*
                    253:  * Text is kept in buffers. A buffer header, described
                    254:  * below, exists for every buffer in the system. The buffers are
                    255:  * kept in a big list, so that commands that search for a buffer by
                    256:  * name can find the buffer header. There is a safe store for the
                    257:  * dot and mark in the header, but this is only valid if the buffer
                    258:  * is not being displayed (that is, if "b_nwnd" is 0). The text for
                    259:  * the buffer is kept in a circularly linked list of lines, with
1.94      kjell     260:  * a pointer to the header line in "b_headp".
1.1       deraadt   261:  */
1.74      deraadt   262: struct buffer {
                    263:        struct list      b_list;        /* buffer list pointer           */
                    264:        struct buffer   *b_altb;        /* Link to alternate buffer      */
1.75      kjell     265:        struct line     *b_dotp;        /* Link to "." line structure    */
1.74      deraadt   266:        struct line     *b_markp;       /* ditto for mark                */
1.94      kjell     267:        struct line     *b_headp;       /* Link to the header line       */
1.74      deraadt   268:        struct maps_s   *b_modes[PBMODES]; /* buffer modes               */
1.75      kjell     269:        int              b_doto;        /* Offset of "." in above line   */
1.60      db        270:        int              b_marko;       /* ditto for the "mark"          */
                    271:        short            b_nmodes;      /* number of non-fundamental modes */
                    272:        char             b_nwnd;        /* Count of windows on buffer    */
                    273:        char             b_flag;        /* Flags                         */
                    274:        char             b_fname[NFILEN]; /* File name                   */
1.86      kjell     275:        char             b_cwd[NFILEN]; /* working directory             */
1.60      db        276:        struct fileinfo  b_fi;          /* File attributes               */
1.113     oga       277:        struct undoq     b_undo;        /* Undo actions list             */
1.67      kjell     278:        struct undo_rec *b_undoptr;
1.92      kjell     279:        int              b_dotline;     /* Line number of dot */
                    280:        int              b_markline;    /* Line number of mark */
                    281:        int              b_lines;       /* Number of lines in file      */
1.74      deraadt   282: };
1.1       deraadt   283: #define b_bufp b_list.l_p.x_bp
                    284: #define b_bname b_list.l_name
1.95      kjell     285:
                    286: /* Some helper macros, in case they ever change to functions */
                    287: #define bfirstlp(buf)  (lforw((buf)->b_headp))
                    288: #define blastlp(buf)   (lback((buf)->b_headp))
1.1       deraadt   289:
1.43      vincent   290: #define BFCHG  0x01                    /* Changed.                      */
                    291: #define BFBAK  0x02                    /* Need to make a backup.        */
1.1       deraadt   292: #ifdef NOTAB
1.43      vincent   293: #define BFNOTAB 0x04                   /* no tab mode                   */
1.1       deraadt   294: #endif
1.43      vincent   295: #define BFOVERWRITE 0x08               /* overwrite mode                */
1.60      db        296: #define BFREADONLY  0x10               /* read only mode                */
1.107     kjell     297: #define BFDIRTY     0x20               /* Buffer was modified elsewhere */
                    298: #define BFIGNDIRTY  0x40               /* Ignore modifications */
1.1       deraadt   299: /*
1.30      vincent   300:  * This structure holds information about recent actions for the Undo command.
                    301:  */
                    302: struct undo_rec {
1.113     oga       303:        TAILQ_ENTRY(undo_rec) next;
1.30      vincent   304:        enum {
                    305:                INSERT = 1,
                    306:                DELETE,
1.93      kjell     307:                BOUNDARY,
1.112     kjell     308:                MODIFIED,
                    309:                DELREG
1.30      vincent   310:        } type;
1.74      deraadt   311:        struct region    region;
1.30      vincent   312:        int              pos;
1.34      deraadt   313:        char            *content;
1.30      vincent   314: };
1.144     bcallah   315:
                    316: /*
                    317:  * Previously from ttydef.h
                    318:  */
                    319: #define STANDOUT_GLITCH                        /* possible standout glitch     */
                    320:
                    321: #define putpad(str, num)       tputs(str, num, ttputc)
                    322:
                    323: #define KFIRST K00
                    324: #define KLAST  K00
1.30      vincent   325:
                    326: /*
1.4       millert   327:  * Prototypes.
                    328:  */
                    329:
1.5       millert   330: /* tty.c X */
1.74      deraadt   331: void            ttinit(void);
                    332: void            ttreinit(void);
                    333: void            tttidy(void);
                    334: void            ttmove(int, int);
                    335: void            tteeol(void);
                    336: void            tteeop(void);
                    337: void            ttbeep(void);
                    338: void            ttinsl(int, int, int);
                    339: void            ttdell(int, int, int);
                    340: void            ttwindow(int, int);
                    341: void            ttnowindow(void);
                    342: void            ttcolor(int);
                    343: void            ttresize(void);
1.31      deraadt   344:
                    345: volatile sig_atomic_t winch_flag;
1.4       millert   346:
                    347: /* ttyio.c */
1.74      deraadt   348: void            ttopen(void);
                    349: int             ttraw(void);
                    350: void            ttclose(void);
                    351: int             ttcooked(void);
                    352: int             ttputc(int);
                    353: void            ttflush(void);
                    354: int             ttgetc(void);
                    355: int             ttwait(int);
1.80      kjell     356: int             charswaiting(void);
1.4       millert   357:
                    358: /* dir.c */
1.74      deraadt   359: void            dirinit(void);
                    360: int             changedir(int, int);
                    361: int             showcwdir(int, int);
1.86      kjell     362: int             getcwdir(char *, size_t);
1.131     jasper    363: int             makedir(int, int);
1.141     lum       364: int             do_makedir(char *);
                    365: int             ask_makedir(void);
1.4       millert   366:
                    367: /* dired.c */
1.74      deraadt   368: struct buffer  *dired_(char *);
1.5       millert   369:
                    370: /* file.c X */
1.74      deraadt   371: int             fileinsert(int, int);
                    372: int             filevisit(int, int);
                    373: int             filevisitalt(int, int);
                    374: int             filevisitro(int, int);
                    375: int             poptofile(int, int);
                    376: int             readin(char *);
                    377: int             insertfile(char *, char *, int);
                    378: int             filewrite(int, int);
                    379: int             filesave(int, int);
                    380: int             buffsave(struct buffer *);
                    381: int             makebkfile(int, int);
1.121     lum       382: int             writeout(FILE **, struct buffer *, char *);
1.74      deraadt   383: void            upmodes(struct buffer *);
1.116     kjell     384: size_t          xbasename(char *, const char *, size_t);
1.5       millert   385:
                    386: /* line.c X */
1.74      deraadt   387: struct line    *lalloc(int);
                    388: int             lrealloc(struct line *, int);
                    389: void            lfree(struct line *);
                    390: void            lchange(int);
                    391: int             linsert_str(const char *, int);
                    392: int             linsert(int, int);
                    393: int             lnewline_at(struct line *, int);
                    394: int             lnewline(void);
                    395: int             ldelete(RSIZE, int);
                    396: int             ldelnewline(void);
                    397: int             lreplace(RSIZE, char *);
1.88      kjell     398: char *          linetostr(const struct line *);
1.78      kjell     399:
                    400: /* yank.c X */
                    401:
1.74      deraadt   402: void            kdelete(void);
                    403: int             kinsert(int, int);
                    404: int             kremove(int);
1.76      kjell     405: int             kchunk(char *, RSIZE, int);
1.78      kjell     406: int             killline(int, int);
                    407: int             yank(int, int);
1.5       millert   408:
                    409: /* window.c X */
1.74      deraadt   410: struct mgwin   *new_window(struct buffer *);
                    411: void            free_window(struct mgwin *);
                    412: int             reposition(int, int);
1.80      kjell     413: int             redraw(int, int);
1.83      otto      414: int             do_redraw(int, int, int);
1.74      deraadt   415: int             nextwind(int, int);
                    416: int             prevwind(int, int);
                    417: int             onlywind(int, int);
                    418: int             splitwind(int, int);
                    419: int             enlargewind(int, int);
                    420: int             shrinkwind(int, int);
                    421: int             delwind(int, int);
1.4       millert   422:
                    423: /* buffer.c */
1.74      deraadt   424: int             togglereadonly(int, int);
1.86      kjell     425: struct buffer   *bfind(const char *, int);
1.74      deraadt   426: int             poptobuffer(int, int);
                    427: int             killbuffer(struct buffer *);
                    428: int             killbuffer_cmd(int, int);
                    429: int             savebuffers(int, int);
                    430: int             listbuffers(int, int);
                    431: int             addlinef(struct buffer *, char *, ...);
1.12      art       432: #define         addline(bp, text)      addlinef(bp, "%s", text)
1.74      deraadt   433: int             anycb(int);
                    434: int             bclear(struct buffer *);
                    435: int             showbuffer(struct buffer *, struct mgwin *, int);
1.86      kjell     436: int             augbname(char *, const char *, size_t);
1.111     kjell     437: struct mgwin    *popbuf(struct buffer *, int);
1.74      deraadt   438: int             bufferinsert(int, int);
                    439: int             usebuffer(int, int);
                    440: int             notmodified(int, int);
1.111     kjell     441: int             popbuftop(struct buffer *, int);
1.86      kjell     442: int             getbufcwd(char *, size_t);
1.107     kjell     443: int             checkdirty(struct buffer *);
1.126     jasper    444: int             revertbuffer(int, int);
1.128     haesbaer  445: int             dorevert(void);
1.134     florian   446: int             diffbuffer(int, int);
1.139     lum       447: struct buffer  *findbuffer(char *);
1.4       millert   448:
                    449: /* display.c */
1.74      deraadt   450: int            vtresize(int, int, int);
                    451: void           vtinit(void);
                    452: void           vttidy(void);
1.138     lum       453: void           update(int);
1.92      kjell     454: int            linenotoggle(int, int);
1.132     florian   455: int            colnotoggle(int, int);
1.5       millert   456:
                    457: /* echo.c X */
1.74      deraadt   458: void            eerase(void);
                    459: int             eyorn(const char *);
1.127     florian   460: int             eynorr(const char *);
1.74      deraadt   461: int             eyesno(const char *);
                    462: void            ewprintf(const char *fmt, ...);
                    463: char           *eread(const char *, char *, size_t, int, ...);
                    464: int             getxtra(struct list *, struct list *, int, int);
                    465: void            free_file_list(struct list *);
1.4       millert   466:
                    467: /* fileio.c */
1.121     lum       468: int             ffropen(FILE **, const char *, struct buffer *);
                    469: void            ffstat(FILE *, struct buffer *);
                    470: int             ffwopen(FILE **, const char *, struct buffer *);
                    471: int             ffclose(FILE *, struct buffer *);
                    472: int             ffputbuf(FILE *, struct buffer *);
                    473: int             ffgetline(FILE *, char *, int, int *);
1.74      deraadt   474: int             fbackupfile(const char *);
1.91      jason     475: char           *adjustname(const char *, int);
1.74      deraadt   476: char           *startupfile(char *);
                    477: int             copy(char *, char *);
                    478: struct list    *make_file_list(char *);
                    479: int             fisdir(const char *);
1.107     kjell     480: int             fchecktime(struct buffer *);
                    481: int             fupdstat(struct buffer *);
1.124     lum       482: int             backuptohomedir(int, int);
                    483: int             toggleleavetmp(int, int);
1.130     jasper    484: char           *expandtilde(const char *);
1.4       millert   485:
1.5       millert   486: /* kbd.c X */
1.74      deraadt   487: int             do_meta(int, int);
                    488: int             bsmap(int, int);
                    489: void            ungetkey(int);
                    490: int             getkey(int);
                    491: int             doin(void);
                    492: int             rescan(int, int);
                    493: int             universal_argument(int, int);
                    494: int             digit_argument(int, int);
                    495: int             negative_argument(int, int);
                    496: int             selfinsert(int, int);
                    497: int             quote(int, int);
1.4       millert   498:
                    499: /* main.c */
1.74      deraadt   500: int             ctrlg(int, int);
                    501: int             quit(int, int);
1.4       millert   502:
                    503: /* ttyio.c */
1.74      deraadt   504: void            panic(char *);
1.4       millert   505:
                    506: /* cinfo.c */
1.80      kjell     507: char           *getkeyname(char  *, size_t, int);
1.4       millert   508:
                    509: /* basic.c */
1.74      deraadt   510: int             gotobol(int, int);
                    511: int             backchar(int, int);
                    512: int             gotoeol(int, int);
                    513: int             forwchar(int, int);
                    514: int             gotobob(int, int);
                    515: int             gotoeob(int, int);
                    516: int             forwline(int, int);
                    517: int             backline(int, int);
                    518: void            setgoal(void);
                    519: int             getgoal(struct line *);
                    520: int             forwpage(int, int);
                    521: int             backpage(int, int);
                    522: int             forw1page(int, int);
                    523: int             back1page(int, int);
                    524: int             pagenext(int, int);
                    525: void            isetmark(void);
                    526: int             setmark(int, int);
1.101     kjell     527: int             clearmark(int, int);
1.74      deraadt   528: int             swapmark(int, int);
                    529: int             gotoline(int, int);
1.126     jasper    530: int             setlineno(int);
1.5       millert   531:
                    532: /* random.c X */
1.74      deraadt   533: int             showcpos(int, int);
1.135     florian   534: int             getcolpos(struct mgwin *);
1.74      deraadt   535: int             twiddle(int, int);
                    536: int             openline(int, int);
1.142     bcallah   537: int             enewline(int, int);
1.74      deraadt   538: int             deblank(int, int);
                    539: int             justone(int, int);
                    540: int             delwhite(int, int);
1.102     kjell     541: int             delleadwhite(int, int);
                    542: int             deltrailwhite(int, int);
                    543: int             lfindent(int, int);
1.74      deraadt   544: int             indent(int, int);
                    545: int             forwdel(int, int);
                    546: int             backdel(int, int);
                    547: int             space_to_tabstop(int, int);
1.114     kjell     548: int             backtoindent(int, int);
1.115     kjell     549: int             joinline(int, int);
1.5       millert   550:
1.117     lum       551: /* tags.c X */
                    552: int             findtag(int, int);
                    553: int             poptag(int, int);
                    554: int             tagsvisit(int, int);
1.123     lum       555: int             curtoken(int, int, char *);
                    556:
                    557: /* cscope.c */
                    558: int            cssymbol(int, int);
                    559: int            csdefinition(int, int);
                    560: int            csfuncalled(int, int);
                    561: int            cscallerfuncs(int, int);
                    562: int            csfindtext(int, int);
                    563: int            csegrep(int, int);
                    564: int            csfindfile(int, int);
                    565: int            csfindinc(int, int);
                    566: int            csnextfile(int, int);
                    567: int            csnextmatch(int, int);
                    568: int            csprevfile(int, int);
                    569: int            csprevmatch(int, int);
                    570: int            cscreatelist(int, int);
1.117     lum       571:
1.5       millert   572: /* extend.c X */
1.74      deraadt   573: int             insert(int, int);
                    574: int             bindtokey(int, int);
                    575: int             localbind(int, int);
1.80      kjell     576: int             redefine_key(int, int);
1.74      deraadt   577: int             unbindtokey(int, int);
                    578: int             localunbind(int, int);
                    579: int             extend(int, int);
                    580: int             evalexpr(int, int);
                    581: int             evalbuffer(int, int);
                    582: int             evalfile(int, int);
                    583: int             load(const char *);
                    584: int             excline(char *);
1.5       millert   585:
                    586: /* help.c X */
1.74      deraadt   587: int             desckey(int, int);
                    588: int             wallchart(int, int);
                    589: int             help_help(int, int);
                    590: int             apropos_command(int, int);
1.5       millert   591:
                    592: /* paragraph.c X */
1.74      deraadt   593: int             gotobop(int, int);
                    594: int             gotoeop(int, int);
                    595: int             fillpara(int, int);
                    596: int             killpara(int, int);
                    597: int             fillword(int, int);
                    598: int             setfillcol(int, int);
1.5       millert   599:
                    600: /* word.c X */
1.74      deraadt   601: int             backword(int, int);
                    602: int             forwword(int, int);
                    603: int             upperword(int, int);
                    604: int             lowerword(int, int);
                    605: int             capword(int, int);
                    606: int             delfword(int, int);
                    607: int             delbword(int, int);
                    608: int             inword(void);
1.5       millert   609:
                    610: /* region.c X */
1.74      deraadt   611: int             killregion(int, int);
                    612: int             copyregion(int, int);
                    613: int             lowerregion(int, int);
                    614: int             upperregion(int, int);
                    615: int             prefixregion(int, int);
                    616: int             setprefix(int, int);
                    617: int             region_get_data(struct region *, char *, int);
1.79      kjell     618: void            region_put_data(const char *, int);
1.119     lum       619: int             markbuffer(int, int);
                    620: int             piperegion(int, int);
1.136     lum       621: int             shellcommand(int, int);
1.133     florian   622: int             pipeio(const char * const, char * const[], char * const, int,
                    623:                     struct buffer *);
1.5       millert   624:
                    625: /* search.c X */
1.74      deraadt   626: int             forwsearch(int, int);
                    627: int             backsearch(int, int);
                    628: int             searchagain(int, int);
                    629: int             forwisearch(int, int);
                    630: int             backisearch(int, int);
                    631: int             queryrepl(int, int);
                    632: int             forwsrch(void);
                    633: int             backsrch(void);
                    634: int             readpattern(char *);
1.5       millert   635:
                    636: /* spawn.c X */
1.74      deraadt   637: int             spawncli(int, int);
1.5       millert   638:
                    639: /* ttykbd.c X */
1.74      deraadt   640: void            ttykeymapinit(void);
                    641: void            ttykeymaptidy(void);
1.5       millert   642:
                    643: /* match.c X */
1.74      deraadt   644: int             showmatch(int, int);
1.5       millert   645:
                    646: /* version.c X */
1.74      deraadt   647: int             showversion(int, int);
1.5       millert   648:
                    649: /* macro.c X */
1.74      deraadt   650: int             definemacro(int, int);
                    651: int             finishmacro(int, int);
                    652: int             executemacro(int, int);
1.5       millert   653:
                    654: /* modes.c X */
1.74      deraadt   655: int             indentmode(int, int);
                    656: int             fillmode(int, int);
                    657: int             blinkparen(int, int);
1.5       millert   658: #ifdef NOTAB
1.74      deraadt   659: int             notabmode(int, int);
1.5       millert   660: #endif /* NOTAB */
1.80      kjell     661: int             overwrite_mode(int, int);
1.74      deraadt   662: int             set_default_mode(int,int);
1.5       millert   663:
                    664: #ifdef REGEX
                    665: /* re_search.c X */
1.74      deraadt   666: int             re_forwsearch(int, int);
                    667: int             re_backsearch(int, int);
                    668: int             re_searchagain(int, int);
                    669: int             re_queryrepl(int, int);
                    670: int             replstr(int, int);
                    671: int             setcasefold(int, int);
                    672: int             delmatchlines(int, int);
                    673: int             delnonmatchlines(int, int);
                    674: int             cntmatchlines(int, int);
                    675: int             cntnonmatchlines(int, int);
1.5       millert   676: #endif /* REGEX */
1.1       deraadt   677:
1.30      vincent   678: /* undo.c X */
1.74      deraadt   679: void            free_undo_record(struct undo_rec *);
                    680: int             undo_dump(int, int);
1.97      kjell     681: int             undo_enabled(void);
1.108     kjell     682: int             undo_enable(int, int);
                    683: int             undo_add_boundary(int, int);
1.93      kjell     684: void            undo_add_modified(void);
1.74      deraadt   685: int             undo_add_insert(struct line *, int, int);
1.112     kjell     686: int             undo_add_delete(struct line *, int, int, int);
1.108     kjell     687: int             undo_boundary_enable(int, int);
1.74      deraadt   688: int             undo_add_change(struct line *, int, int);
                    689: int             undo(int, int);
1.41      vincent   690:
                    691: /* autoexec.c X */
1.74      deraadt   692: int             auto_execute(int, int);
                    693: PF             *find_autoexec(const char *);
                    694: int             add_autoexec(const char *, const char *);
1.46      vincent   695:
1.103     kjell     696: /* cmode.c X */
                    697: int             cmode(int, int);
1.104     kjell     698: int             cc_brace(int, int);
1.103     kjell     699: int             cc_char(int, int);
                    700: int             cc_tab(int, int);
                    701: int             cc_indent(int, int);
                    702: int             cc_lfindent(int, int);
1.66      kjell     703:
                    704: /* grep.c X */
1.74      deraadt   705: int             next_error(int, int);
1.100     kjell     706: int             globalwdtoggle(int, int);
1.106     kjell     707: int             compile(int, int);
1.30      vincent   708:
1.138     lum       709: /* bell.c */
                    710: void            bellinit(void);
                    711: int             toggleaudiblebell(int, int);
                    712: int             togglevisiblebell(int, int);
                    713: void            dobeep(void);
                    714:
1.1       deraadt   715: /*
                    716:  * Externals.
                    717:  */
1.74      deraadt   718: extern struct buffer   *bheadp;
                    719: extern struct buffer   *curbp;
                    720: extern struct mgwin    *curwp;
                    721: extern struct mgwin    *wheadp;
                    722: extern int              thisflag;
                    723: extern int              lastflag;
                    724: extern int              curgoal;
                    725: extern int              startrow;
                    726: extern int              epresf;
                    727: extern int              sgarbf;
                    728: extern int              mode;
                    729: extern int              nrow;
                    730: extern int              ncol;
                    731: extern int              ttrow;
                    732: extern int              ttcol;
                    733: extern int              tttop;
                    734: extern int              ttbot;
                    735: extern int              tthue;
                    736: extern int              defb_nmodes;
                    737: extern int              defb_flag;
1.138     lum       738: extern int              doaudiblebell;
                    739: extern int              dovisiblebell;
1.117     lum       740: extern char             cinfo[];
1.74      deraadt   741: extern char            *keystrings[];
                    742: extern char             pat[NPAT];
                    743: extern char             prompt[];
1.5       millert   744:
                    745: /*
                    746:  * Globals.
                    747:  */
1.74      deraadt   748: int             tceeol;
                    749: int             tcinsl;
                    750: int             tcdell;
1.105     kjell     751: int             rptcount;      /* successive invocation count */