aboutsummaryrefslogtreecommitdiff
path: root/lib/io
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-02-08 21:39:42 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2023-02-08 21:39:42 +0100
commit764f8d22b250e09c1dea98fb8073e71a720892f7 (patch)
tree8357f9f673846125ac49ff0f12288d242eb2fa49 /lib/io
parentb97ec93748902c90f25524116d3d189f1b263474 (diff)
add pager
Diffstat (limited to 'lib/io')
-rw-r--r--lib/io/io.c5
-rw-r--r--lib/io/io.h6
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/io/io.c b/lib/io/io.c
index 7dee314..57cfd05 100644
--- a/lib/io/io.c
+++ b/lib/io/io.c
@@ -15,9 +15,9 @@ void wstd(const char *buf)
}
-void rstd(char *buf, unsigned long count)
+unsigned long rstd(char *buf, unsigned long count)
{
- read(STDIN_FD, buf, count);
+ return read(STDIN_FD, buf, count);
}
@@ -26,6 +26,7 @@ void wf(unsigned int fd, char *buf)
write(fd, buf, cstr_length(buf));
}
+
void wstdf__(const char *buf, const void **args)
{
wff__(STDOUT_FD, buf, args);
diff --git a/lib/io/io.h b/lib/io/io.h
index c373cd0..ac25e87 100644
--- a/lib/io/io.h
+++ b/lib/io/io.h
@@ -3,9 +3,9 @@
#include "../sys/io.h"
-void wstd(const char *buf);
-void rstd(char *buf, unsigned long count);
-void wf(unsigned int fd, char *buf);
+void wstd(const char *buf);
+unsigned long rstd(char *buf, unsigned long count);
+void wf(unsigned int fd, char *buf);
void wstdf__(const char *buf, const void **args);
void wff__(unsigned int fd, const char *buf, const void **args);