diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-09-28 21:20:40 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-09-28 21:33:03 +0200 |
commit | 8e7e029114c59341ec793dc9e96ee410a5f37e2b (patch) | |
tree | ac196b359c93716158dedd767f425d9e093c9b71 /src/buffer.c | |
parent | f9a8fff2f90626aadd915178d04ece49d8c4884a (diff) |
update to version 25meson
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 28 |
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; |