mirror of /home/gitosis/repositories/libowfat.git

7 changed files with 72 additions and 2 deletions
@ -0,0 +1,13 @@
|
||||
#include <stdlib.h> |
||||
#include <unistd.h> |
||||
#include "buffer.h" |
||||
|
||||
int buffer_init_allocbuf(buffer* b, ssize_t (*op)(), int fd, size_t ylen) { |
||||
if (fd==-1) return -1; |
||||
char* thebuffer; |
||||
if (!(thebuffer=malloc(ylen))) |
||||
return -1; |
||||
buffer_init_free(b, op, fd, thebuffer, ylen); |
||||
return 0; |
||||
} |
||||
|
@ -0,0 +1,9 @@
|
||||
#include <unistd.h> |
||||
#include <buffer.h> |
||||
|
||||
int buffer_init_read(buffer* b, int fd, char* y,size_t ylen) { |
||||
if (fd==-1) return -1; |
||||
buffer_init(b, read, fd, y, ylen); |
||||
return 0; |
||||
} |
||||
|
@ -0,0 +1,7 @@
|
||||
#include <unistd.h> |
||||
#include "buffer.h" |
||||
|
||||
int buffer_init_read_allocbuf(buffer* b, int fd, size_t ylen) { |
||||
return buffer_init_allocbuf(b, read, fd, ylen); |
||||
} |
||||
|
@ -0,0 +1,9 @@
|
||||
#include <unistd.h> |
||||
#include <buffer.h> |
||||
|
||||
int buffer_init_write(buffer* b, int fd, char* y,size_t ylen) { |
||||
if (fd==-1) return -1; |
||||
buffer_init(b, write, fd, y, ylen); |
||||
return 0; |
||||
} |
||||
|
Loading…
Reference in new issue