|
|
1.1 root 1: #include "cbt.h"
2:
3: extern bfile *curbf;
4: extern long lseek();
5:
6: ndrd(lev, where) ndaddr where;
7: {
8: register n;
9: if(mustwrite(curbf, lev)) {
10: /* do we ever get here? (yes, while splitting) */
11: if(ndwrt(curbf->path[lev], curbf->loc[lev]) == EOF)
12: return(EOF);
13: mustwrite(curbf, lev) = 0;
14: }
15: if(lseek(curbf->tfd, where * (long)NDSZ, 0) == -1)
16: return(EOF);
17: if((n = read(curbf->tfd, (char *)curbf->path[lev], NDSZ)) != NDSZ) {
18: if(n >= 0)
19: errno = BRDERR;
20: return(EOF);
21: }
22: curbf->loc[lev] = where;
23: return(0);
24: }
25:
26: getincore(lev, where) ndaddr where;
27: {
28: if(ndrd(lev, where) == EOF)
29: return(EOF);
30: if(curbf->path[lev]->hlev != lev) {
31: errno = BRDERR;
32: curbf->fatal++;
33: return(EOF);
34: }
35: return(0);
36: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.