|
|
1.1 root 1: /* Copyright Bell Telephone Laboratories Whippany, N.J.
2:
3: * ***********************************
4: * ***********************************
5: * ****** UPDATE THE PAGE INDEX ******
6: * *** R. B. Drake WH 8C-005 X4163 ***
7: * **** Sun Aug 26 12:02:08 1979 *****
8: * ***********************************
9: * ***********************************
10:
11: */
12: /* "@(#) update.c: V 1.1 12/21/80" */
13:
14: /* after a shift of the lines in the program txtbuf, that portion of
15: * the page index from the current page upward must be rebuilt or
16: * "updated" */
17: #include "bas.h"
18:
19: update()
20: {
21: char *uptr;
22: if(index[pg].maxlin == 0)
23: uptr = txtbuf;
24: else
25: uptr = index[pg].begin;
26: while(1)
27: {
28: pg = (uptr - txtbuf) /PGSIZ;
29: if(fetch(-1,&uptr) != 0) return(0);
30: if(index[pg].maxlin == 0)
31: {
32: index[pg].maxlin = inst.thing.linno;
33: index[pg].begin = curptr;
34: }
35: if(inst.thing.linno > index[pg].maxlin)
36: index[pg].maxlin = inst.thing.linno;
37: }
38: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.