Tchatator413
TripEnArvor instant messaging protocol - JSON-based
Loading...
Searching...
No Matches
slice.h
Go to the documentation of this file.
1
5
6#ifndef SLICE_H
7#define SLICE_H
8
9#include <stdlib.h>
10
12typedef struct {
13 size_t len;
15 char const *val;
16} slice_t;
17
18#define SLICE_CONST(STRLIT) \
19 (slice_t) { .len = sizeof STRLIT - 1, .val = STRLIT }
20
25
26#endif // SLICE_H
int slice_leni(slice_t slice)
Returns the length of a slice as a signed integer.
A memory slice.
Definition slice.h:12
char const * val
Definition slice.h:15