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

#include <sys/types.h>
#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, size_t len)
{
  if (!cbuffer_init(&b->c, s, len)) return 0 ;
  b->fd = fd ;
  b->op = op ;
  return 1 ;
}