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

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

unsigned int cbuffer_get (cbuffer_t *b, char *s, unsigned int len)
{
  siovec_t v[2] ;
  register unsigned int w ;
  cbuffer_rpeek(b, v) ;
  w = siovec_gather(v, 2, s, len) ;
  return cbuffer_RSEEK(b, w) ;
}