asrt
Automated System Runtime Testing library
Loading...
Searching...
No Matches
span.h
1
11
12#ifndef ASRT_SPAN_H
13#define ASRT_SPAN_H
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#include <stdint.h>
20
23{
24 uint8_t* b;
25 uint8_t* e;
26};
27
29static inline uint8_t asrt_span_unfit_for( struct asrt_span const* buff, uint32_t size )
30{
31 return (uint32_t) ( buff->e - buff->b ) < size ? 1U : 0U;
32}
33
37{
38 uint8_t* b;
39 uint8_t* e;
40 struct asrt_span* rest;
41 uint32_t rest_count;
42};
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif
Scatter-gather buffer: a primary byte range [b, e) followed by rest_count additional spans.
Definition: span.h:37
uint32_t rest_count
Number of entries in rest.
Definition: span.h:41
struct asrt_span * rest
Optional array of additional byte ranges.
Definition: span.h:40
uint8_t * b
Primary buffer start.
Definition: span.h:38
uint8_t * e
Primary buffer one-past-the-end.
Definition: span.h:39
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: span.h:23
uint8_t * b
Pointer to the first byte.
Definition: span.h:24
uint8_t * e
One-past-the-end pointer.
Definition: span.h:25