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