summaryrefslogtreecommitdiff
path: root/src/libstddjb/cbuffer_getv.c
blob: 99808fd7c294dd0b4cf03133feb1c532b99cb70a (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 *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) ;
}