1 /* Begin include file curshdr.h */ 2 3 /* "@(#)curshdr.h 1.1" (1.16 3/16/83) */ 4 5 /*LINTLIBRARY*/ 6 7 /* 8 * IC and IL overheads and costs should be set to this 9 * value if the corresponding feature is missing 10 */ 11 #define INFINITY 500 12 13 struct line 14 { 15 int hash; /* hash value for this line, 0 if not known */ 16 struct line *next; /* pointer to the next line in list of lines */ 17 short bodylen; /* the cost of redrawing this line */ 18 short length; /* the number of valid characters in line */ 19 chtype *body; /* the actual text of the line */ 20 }; 21 22 struct costs { 23 short Cursor_address; 24 short Cursor_home; 25 short Carriage_return; 26 short Tab; 27 short Back_tab; 28 short Cursor_left; 29 short Cursor_right; /* current cost, which is 1 unless in insert 30 * mode, since you can just output the 31 * character you want to move over */ 32 short Right_base; /* actual cost to do cursor_right */ 33 short Cursor_down; 34 short Cursor_up; 35 short Parm_left_cursor; 36 short Parm_right_cursor; 37 short Parm_up_cursor; 38 short Parm_down_cursor; 39 short Column_address; 40 short Row_address; 41 unsigned ilvar; /* Insert line varying part * 32 */ 42 int ilfixed; /* Insert line fixed overhead */ 43 unsigned dlvar; /* Delete line varying part * 32 */ 44 int dlfixed; /* Delete line fixed overhead */ 45 unsigned icvar; /* Insert char varying part * 32 */ 46 int icfixed; /* Insert char fixed overhead */ 47 unsigned dcvar; /* Delete char varying part * 32 */ 48 int dcfixed; /* Delete char fixed overhead */ 49 /* Should have costs for delete char/delete line here too. */ 50 }; 51 #define _cost(field) (SP->term_costs.field) 52 53 struct map { 54 char label[16]; /* Text the key is labelled with */ 55 char sends[16]; /* Characters sent when key is pressed */ 56 /*short*/ int keynum; /* "char" we pass back to program */ 57 }; 58 59 struct screen { 60 unsigned fl_nonl : 1; /* we shouldn't output \n */ 61 unsigned fl_uppercase : 1; /* upper case terminal */ 62 unsigned fl_normtty : 1; /* currently in normal tty mode */ 63 unsigned fl_my_term : 1; /* user names his terminal type */ 64 unsigned fl_echoit : 1; /* in software echo mode */ 65 unsigned fl_rawmode : 1; /* in raw or cbreak mode */ 66 unsigned fl_endwin : 1; /* has called endwin */ 67 unsigned phys_irm : 1; /* physically in insert char mode */ 68 unsigned virt_irm : 1; /* want to be in insert char mode */ 69 unsigned fl_nodelay : 1; /* tty is in nodelay mode */ 70 struct line **cur_body; /* physical screen image */ 71 struct line **std_body; /* desired screen image */ 72 struct line *freelist; /* free space list */ 73 short phys_x; /* physical cursor X position */ 74 short phys_y; /* physical cursor Y position */ 75 short virt_x; /* virtual cursor X position */ 76 short virt_y; /* virtual cursor Y position */ 77 short phys_top_mgn; /* physical top margin of scrolling region */ 78 short phys_bot_mgn; /* physical bottom margin of scrolling region */ 79 short des_top_mgn; /* desired top margin of scrolling region */ 80 short des_bot_mgn; /* desired bottom margin of scrolling region */ 81 chtype *curptr; /* pointer to cursor */ 82 chtype virt_gr; /* desired highlight state */ 83 chtype phys_gr; /* current highlight state */ 84 short winsize; /* no. of lines on which ID operations done */ 85 short doclear; /* flag to say whether screen garbaged */ 86 short baud; /* baud rate of this tty */ 87 short check_input; /* flag for input check */ 88 short check_fd; /* file descriptor for input check */ 89 struct _win_st *std_scr;/* primary output screen */ 90 struct _win_st *cur_scr;/* what's physically on the screen */ 91 struct term *tcap; /* TERMCAP strings and storage space */ 92 struct costs term_costs;/* costs of various capabilities */ 93 short kp_state; /* 1 iff keypad is on, else 0 */ 94 short ml_above; /* # memory lines above top of screen */ 95 #ifndef NONSTANDARD 96 SGTTY save_tty_buf; /* current state of this tty */ 97 FILE *term_file; /* File to write on for output. */ 98 #endif NONSTANDARD 99 #ifdef KEYPAD 100 struct map *kp; /* keypad map */ 101 #endif KEYPAD 102 short *input_queue; /* a place to put stuff ungetc'ed */ 103 FILE *input_file; /* Where to get keyboard input */ 104 }; 105 106 #ifndef NONSTANDARD 107 extern struct screen *SP; 108 #endif 109 110 #ifdef DEBUG 111 extern FILE *outf; 112 #endif 113 114 115 /* End include file curshdr.h */