Files
mars-libowfat/buffer/buffer_init_allocbuf.c
2025-01-20 16:39:51 +00:00

14 lines
301 B
C

#include <stdlib.h>
#include <unistd.h>
#include <libowfat/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;
}