summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/buffer.c b/src/buffer.c
index f094213..68327b8 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -27,16 +27,26 @@ static ssize_t buffer_0_read(int fd, char *buf, size_t len)
return read(fd, buf, len);
}
+ssize_t buffer_unixread(int fd, char *buf, size_t len)
+{
+ return (ssize_t)read(fd, buf, len);
+}
+
+ssize_t buffer_unixwrite(int fd, char *buf, size_t len)
+{
+ return (ssize_t)write(fd, buf, len);
+}
+
char buffer_0_space[BUFFER_INSIZE];
static buffer it0 = BUFFER_INIT(buffer_0_read, 0, buffer_0_space, sizeof(buffer_0_space));
buffer *buffer_0 = &it0;
char buffer_1_space[BUFFER_OUTSIZE];
-static buffer it1 = BUFFER_INIT(write, 1, buffer_1_space, sizeof(buffer_1_space));
+static buffer it1 = BUFFER_INIT(buffer_unixwrite, 1, buffer_1_space, sizeof(buffer_1_space));
buffer *buffer_1 = &it1;
char buffer_2_space[BUFFER_OUTSIZE];
-static buffer it2 = BUFFER_INIT(write, 2, buffer_2_space, sizeof(buffer_2_space));
+static buffer it2 = BUFFER_INIT(buffer_unixwrite, 2, buffer_2_space, sizeof(buffer_2_space));
buffer *buffer_2 = &it2;
char buffer_0_small[BUFFER_SMALL];
@@ -44,23 +54,13 @@ static buffer is0 = BUFFER_INIT(buffer_0_read, 0, buffer_0_small, sizeof(buffer_
buffer *buffer_0small = &is0;
char buffer_1_small[BUFFER_SMALL];
-static buffer is1 = BUFFER_INIT(write, 1, buffer_1_small, sizeof(buffer_1_small));
+static buffer is1 = BUFFER_INIT(buffer_unixwrite, 1, buffer_1_small, sizeof(buffer_1_small));
buffer *buffer_1small = &is1;
char buffer_2_small[BUFFER_SMALL];
-static buffer is2 = BUFFER_INIT(write, 2, buffer_2_small, sizeof(buffer_2_small));
+static buffer is2 = BUFFER_INIT(buffer_unixwrite, 2, buffer_2_small, sizeof(buffer_2_small));
buffer *buffer_2small = &is2;
-ssize_t buffer_unixread(int fd, char *buf, size_t len)
-{
- return read(fd, buf, len);
-}
-
-ssize_t buffer_unixwrite(int fd, char *buf, size_t len)
-{
- return write(fd, buf, len);
-}
-
int buffer_copy(buffer *bout, buffer *bin)
{
int n;