You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libowfat/buffer/buffer_init_allocbuf.c

14 lines
292 B
C

#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;
}