summaryrefslogtreecommitdiff
path: root/src/libstddjb/buffer_init.c
blob: e143d705027d9977298c21ef736c01627fcd45bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* ISC license. */

#include <errno.h>
#include <skalibs/cbuffer.h>
#include <skalibs/buffer.h>

int buffer_init (buffer *b, iovfunc_t_ref op, int fd, char *s, size_t len)
{
  if (!cbuffer_init(&b->c, s, len)) return 0 ;
  b->fd = fd ;
  b->op = op ;
  return 1 ;
}