1 b2cfc4e2 2003-09-30 devnull #include "lib9.h"
2 b2cfc4e2 2003-09-30 devnull #include <bio.h>
4 b2cfc4e2 2003-09-30 devnull struct bgetd
6 b2cfc4e2 2003-09-30 devnull Biobuf* b;
10 b2cfc4e2 2003-09-30 devnull static int
11 b2cfc4e2 2003-09-30 devnull Bgetdf(void *vp)
14 b2cfc4e2 2003-09-30 devnull struct bgetd *bg = vp;
16 b2cfc4e2 2003-09-30 devnull c = Bgetc(bg->b);
17 b2cfc4e2 2003-09-30 devnull if(c == Beof)
18 b2cfc4e2 2003-09-30 devnull bg->eof = 1;
19 b2cfc4e2 2003-09-30 devnull return c;
23 b2cfc4e2 2003-09-30 devnull Bgetd(Biobuf *bp, double *dp)
25 b2cfc4e2 2003-09-30 devnull double d;
26 b2cfc4e2 2003-09-30 devnull struct bgetd b;
28 b2cfc4e2 2003-09-30 devnull b.b = bp;
29 b2cfc4e2 2003-09-30 devnull b.eof = 0;
30 b2cfc4e2 2003-09-30 devnull d = fmtcharstod(Bgetdf, &b);
31 b2cfc4e2 2003-09-30 devnull if(b.eof)
32 b2cfc4e2 2003-09-30 devnull return -1;
33 b2cfc4e2 2003-09-30 devnull Bungetc(bp);
35 b2cfc4e2 2003-09-30 devnull return 1;