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

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

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