summaryrefslogtreecommitdiff
path: root/src/include/skalibs/siovec.h
blob: 8c8161f0aa4fa099cf54fb629007cb63d016d088 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* ISC license. */

#ifndef SIOVEC_H
#define SIOVEC_H

#include <sys/types.h>
#include <sys/uio.h>
#include <skalibs/gccattributes.h>

typedef struct siovec_s siovec_t, *siovec_t_ref ;
struct siovec_s
{
  char *s ;
  unsigned int len ;
} ;

extern unsigned int siovec_len (siovec_t const *, unsigned int) gccattr_pure ;
extern unsigned int siovec_gather (siovec_t const *, unsigned int, char *, unsigned int) ;
extern unsigned int siovec_scatter (siovec_t const *, unsigned int, char const *, unsigned int) ;
extern unsigned int siovec_deal (siovec_t const *, unsigned int, siovec_t const *, unsigned int) ;
extern unsigned int siovec_seek (siovec_t *, unsigned int, unsigned int) ;

extern void siovec_from_iovec (siovec_t *, struct iovec const *, unsigned int) ;
extern void iovec_from_siovec (struct iovec *, siovec_t const *, unsigned int) ;

extern unsigned int siovec_bytechr (siovec_t const *, unsigned int, char) ;
extern unsigned int siovec_bytein (siovec_t const *, unsigned int, char const *, unsigned int) ;

#endif