skalibs

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

cbuffer_get.c (282B)


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