skalibs

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

cbuffer_put.c (289B)


      1 /* ISC license. */
      2 
      3 #include <sys/uio.h>
      4 #include <skalibs/siovec.h>
      5 #include <skalibs/cbuffer.h>
      6 
      7 size_t cbuffer_put (cbuffer *b, char const *s, size_t len)
      8 {
      9   struct iovec v[2] ;
     10   size_t w ;
     11   cbuffer_wpeek(b, v) ;
     12   w = siovec_scatter(v, 2, s, len) ;
     13   return cbuffer_WSEEK(b, w) ;
     14 }