skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

cbuffer_init.c (229B)


      1 /* ISC license. */
      2 
      3 #include <errno.h>
      4 #include <skalibs/cbuffer.h>
      5 
      6 int cbuffer_init (cbuffer *b, char *s, size_t len)
      7 {
      8   if (len < 2) return (errno = EINVAL, 0) ;
      9   b->x = s ;
     10   b->a = len ;
     11   b->p = b->n = 0 ;
     12   return 1 ;
     13 }