skalibs

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

cbuffer_getv.c (306B)


      1 /* ISC license. */
      2 
      3 #include <sys/uio.h>
      4 #include <skalibs/siovec.h>
      5 #include <skalibs/cbuffer.h>
      6 
      7 size_t cbuffer_getv (cbuffer *b, struct iovec const *v, unsigned int n)
      8 {
      9   struct iovec vsrc[2] ;
     10   size_t w ;
     11   cbuffer_rpeek(b, vsrc) ;
     12   w = siovec_deal(v, n, vsrc, 2) ;
     13   return cbuffer_RSEEK(b, w) ;
     14 }