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