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