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

#include <sys/uio.h>
#include <skalibs/siovec.h>
#include <skalibs/cbuffer.h>

size_t cbuffer_getv (cbuffer_t *b, struct iovec const *v, unsigned int n)
{
  struct iovec vsrc[2] ;
  size_t w ;
  cbuffer_rpeek(b, vsrc) ;
  w = siovec_deal(v, n, vsrc, 2) ;
  return cbuffer_RSEEK(b, w) ;
}