commit 40d5897b2aada68f0789cd7e7154705cc3c0ad49
parent 107f4e22b36657e9d2896b40b025fe91a615906f
Author: Amitai Schleier <schmonz-web-git@schmonz.com>
Date: Thu, 17 Dec 2020 10:29:00 +0100
Revert "remove unused substdio_bget()"
This reverts commit 5a214f931f1b5575e3cf4b037179eb5f665028c1.
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/substdi.c b/substdi.c
@@ -43,6 +43,19 @@ ssize_t substdio_feed(substdio *s)
return r;
}
+int substdio_bget(s,buf,len)
+register substdio *s;
+register char *buf;
+register int len;
+{
+ register int r;
+
+ if (s->p > 0) return getthis(s,buf,len);
+ r = s->n; if (r <= len) return oneread(s->op,s->fd,buf,r);
+ r = substdio_feed(s); if (r <= 0) return r;
+ return getthis(s,buf,len);
+}
+
ssize_t substdio_get(substdio *s, char *buf, size_t len)
{
ssize_t r;
diff --git a/substdio.h b/substdio.h
@@ -24,6 +24,7 @@ extern int substdio_bputs();
extern int substdio_putsflush();
extern ssize_t substdio_get(substdio *s, char *buf, size_t len);
+extern int substdio_bget();
extern ssize_t substdio_feed(substdio *s);
extern char *substdio_peek();