1 /* BEGIN INCLUDE FILE ..... tedbcb.incl.pl1 ..... 01/29/82 J Falksen */ 2 3 /* UPDATE HISTORY (finally) */ 4 /* EL# date TR comments */ 5 /* --- 84-10-19 -------- add sws.INPUT */ 6 /* --- 84-10-29 -------- add sws.invoking */ 7 8 /* if the structure of buf_des changes, tedcommon_.alm and */ 9 /* tedcommon.incl.pl1 must be appropriately changed */ 10 11 dcl 1 buf_des (all_des) based (bp), /* buffer part descriptor */ 12 2 l, /* left end (LHE) data (see Note 1) */ 13 3 ln fixed bin (21), /* line number */ 14 3 le fixed bin (21), /* left end (LE) offset */ 15 3 re fixed bin (21), /* right end (RE) offset */ 16 2 r like buf_des.l; /* right end (RHE) data */ 17 18 /* Note1: buf_des describes 2 slightly different things, buffer parts and */ 19 /* addresses. These are the circumstances: */ 20 /* */ 21 /* */ 22 /* |...............<buffer>..........................| */ 23 /* b.cur.sp| |..........<window>...........| | */ 24 /* Buffer: xxxxxxxxxxwwwwwwwwwwwww...<hole>...wwwwwwxxxxxxxxxx */ 25 /* | | | | | */ 26 /* b.b_.l.le| b.b_.l.re| b.b_.r.le| | maxl| */ 27 /* b.b_.l.ln| b.b_.r.le| maxln| */ 28 /* b.b_.r.ln| */ 29 /* b.b_.l.ln (if known) tells the # of lines in left part of window */ 30 /* b.b_.r.ln (if known) tells the # of lines the whole window */ 31 /* b.maxln (if known) tells the # of lines in the whole buffer */ 32 /* Either left or right part may be null. A ^read file */ 33 /* is in the right part. A file is always read at the */ 34 /* upper end of the hole. This will usually minimize the */ 35 /* amount of data movement during subsequent editing */ 36 /* operations. */ 37 /* */ 38 /* Data movement which occurs within a request, for example substitute, can */ 39 /* cause an offset to temporarily point into the hole. This will clear up */ 40 /* before the operation is complete. */ 41 42 /* N */ 43 /* Address: ....xxxxxxxxxxsssss -- sssssssxxxxxxxxxxL.... */ 44 /* | | | | */ 45 /* l.le| l.re| r.le| r.re| */ 46 /* l.ln| r.ln| */ 47 /* l.re is the beginning of the string addressed. */ 48 /* l.le is the beginning of line containing location l.re */ 49 /* Thus l.ln is related to both l.re and l.le */ 50 /* r.re is the end of the string addressed. */ 51 /* r.le is the end of line containing location r.re */ 52 /* Thus r.ln is related to both r.re and r.le */ 53 /* (l.le and r.le relate to the same line when 1 line is addressed) */ 54 /* In line mode each request starts with l.re=l.le & r.re=r.le */ 55 /* In string mode a global request forces these conditions. */ 56 57 /*** b_c/b_s reference the string which represents the buffer data. */ 58 dcl b_c (b.maxl) char (1) based (b.cur.sp); 59 dcl b_s char (b.maxl) based (b.cur.sp); 60 61 dcl (live_des init (8), 62 all_des init (13), 63 reloc_first init (2), /* where to begin minus 1 */ 64 reloc_last init (8) /* where to stop */ 65 ) fixed bin int static options (constant); 66 dcl bp ptr; 67 dcl 1 b based (bp), /* ted buffer control block */ 68 2 b_ like buf_des, /* defines buffer limits */ 69 2 newb like buf_des, /* pending buffer values */ 70 2 ex like buf_des, /* execution limits */ 71 2 a_ (0:2) like buf_des, /* address data */ 72 /* (0) "cur location" */ 73 /* (1) 1st addr result */ 74 /* (2) 2nd addr result */ 75 2 cd like buf_des, /* copy destination */ 76 2 gb like buf_des, /* info for global processing */ 77 2 newa like buf_des, /* pending address values */ 78 /* ----limit of relocation---- */ 79 /* these are not relocated because they define the relocation data */ 80 2 rel_temp like buf_des, /* hold during relocation */ 81 2 temp (0:2) like buf_des, /* hold during [.]addr processing */ 82 2 old, /* where string used to be */ 83 3 (le,re) fixed bin (21), /* ends of range */ 84 2 new like b.old, /* where string has gone to */ 85 2 test like b.old, /* allowable relocatable range */ 86 /* (may be 1 or 2 larger than b.old) */ 87 2 cur like seg_des, /* CURRENT buffer area info */ 88 /* (see note 2) */ 89 2 pend like seg_des, /* PENDING buffer area info */ 90 2 file_d, /* file related data */ 91 3 dtcm bit(36), /* when read seg was modified */ 92 3 uid bit(36), /* unique ID of segment */ 93 3 dname char(168), /* directory of file */ 94 3 ename char(32), /* entry of file */ 95 3 cname char(32), /* component of file */ 96 3 kind char(1)unal, /* kind of component */ 97 /* " "-none, ":"-archive */ 98 /* "|"-superfile */ 99 3 sws unal, 100 4 file_sw bit(1), /* 1-file associated */ 101 4 trust_sw bit(1), /* 1-file name trustable */ 102 4 mod_sw bit(1), /* 1-buffer has been modified */ 103 4 terminate bit(1), /* 1-dp points to file, terminate */ 104 4 get_bit_count bit(1), /* 1-get_bit_count before using this */ 105 /* buffer, it may have been modified by */ 106 /* externally via [ted$buffer xx] usage */ 107 4 force_name bit(1), /* 1-name has been forced */ 108 4 no_io bit(1), /* 1-no r w ^b allowed */ 109 /* (external string edit) */ 110 4 not_pasted bit(1), /* 1-data was moved into buffer but */ 111 /* has not been read anywhere */ 112 4 initiate bit(1), /* 1-must initiate on restart */ 113 /* (b% and b!) */ 114 4 ck_ptr_sw bit(1), /* 1-if segment is external, must */ 115 /* check pointer before ref */ 116 4 pseudo bit (1), /* 1-^read or read-only buffer */ 117 4 INPUT bit (1), /* 1-active INPUT mode on buffer */ 118 4 invoking bit (1), /* 1-buffer being invoked */ 119 4 fill bit (14), 120 2 name char(16), /* buffer name */ 121 2 fill char(27), 122 2 stackl bit (18)aligned, /* offset of list of stacked data */ 123 2 stack_o bit (18)aligned, /* offset of data being relocated */ 124 2 present (0:2) bit(1), /* 1 if addr present */ 125 2 tw_sw bit(1), /* 1-typewriter buffer */ 126 2 bs, /* Old-style escapes in this buffer */ 127 3 (c,b,r,f) bit(1), /* 1-\031,\030,\036,\034 found */ 128 2 noref bit(1), /* 1-not ref'ed, don't list */ 129 2 maxl fixed bin(21), /* max buffer length in this AST */ 130 2 maxln fixed bin(21), /* number of lines in buffer */ 131 2 state_r fixed bin(21), /* what state is request in */ 132 2 (N1,N2,N3) fixed bin(21), /* values kept for -safe_ty */ 133 2 state_b fixed bin(21); /* what state is buffer change in */ 134 135 /* Note2: sn=0 means empty because the database segment will never */ 136 /* contain a buffer holder */ 137 /* sn=-1 (&^b.terminate) means read-only data, if modification is */ 138 /* done, a copy will be made. */ 139 /* sn=-1 (& b.terminate) means ^read file, if modification is done */ 140 /* the file is read first */ 141 /* sn>0 means a buffer holder segment */ 142 143 /* END INCLUDE FILE ..... tedbcb.incl.pl1 ..... */