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