aboutsummaryrefslogtreecommitdiff
path: root/sys/base/bufio/refill.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/base/bufio/refill.h')
-rw-r--r--sys/base/bufio/refill.h28
1 files changed, 0 insertions, 28 deletions
diff --git a/sys/base/bufio/refill.h b/sys/base/bufio/refill.h
deleted file mode 100644
index 41e357e..0000000
--- a/sys/base/bufio/refill.h
+++ /dev/null
@@ -1,28 +0,0 @@
-int
-refill(io·Buffer *buf)
-{
- int n;
-
- if(buf->state & bufio·end)
- return bufio·err;
-
- memcpy(buf->buf, buf->pos - bufio·ungets, bufio·ungets);
-
- n = buf->rdr.read(buf->h, 1, buf->size, buf->beg);
- if(n < 0)
- return bufio·err;
- if(n == 0){
- buf->state |= bufio·end;
- return 0;
- }
-
- buf->pos = buf->beg;
- buf->end = buf->pos + n;
-
- // TEST: put a physical EOF byte at the end
- // this would allow for an unget operation
- if(n < buf->size)
- *buf->end++ = EOF;
-
- return n;
-}