|
|
1.1 root 1: # include <ingres.h>
2: # include <access.h>
3: # include <sccs.h>
4:
5: SCCSID(@(#)formatpg.c 7.1 2/5/81)
6:
7: formatpg(d, n)
8: DESC *d;
9: long n;
10: {
11: struct accbuf buf;
12: register char *p;
13: extern long lseek();
14:
15: if (Acc_head == 0)
16: acc_init();
17: if (lseek(d->relfp, 0l, 0) == -1)
18: return (-2);
19: buf.rel_tupid = d->reltid.ltid;
20: buf.filedesc = d->relfp;
21: for (p = (char *) &buf; p <= (char *) buf.linetab; p++)
22: *p = NULL;
23: buf.nxtlino = 0;
24: buf.linetab[0] = (int) buf.firstup - (int) &buf;
25: buf.ovflopg = 0;
26: for (buf.mainpg = 1; buf.mainpg < n; (buf.mainpg)++)
27: {
28: if (write(buf.filedesc, (char *) &buf, PGSIZE) != PGSIZE)
29: return (-3);
30: }
31: buf.mainpg = 0;
32: if (write(buf.filedesc, (char *) &buf, PGSIZE) != PGSIZE)
33: return (-4);
34: Accuwrite += n;
35: return (0);
36: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.