rtl433  UNKNOWN
RTL-433 utility
abuf.h
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_ABUF_H_
13 #define INCLUDE_ABUF_H_
14 
15 #if defined _MSC_VER // Microsoft Visual Studio
16  // MSC has something like C99 restrict as __restrict
17 #ifndef restrict
18 #define restrict __restrict
19 #endif
20 #endif
21 
22 #include <stddef.h>
23 
24 typedef struct abuf {
25  char *head;
26  char *tail;
27  size_t left;
28 } abuf_t;
29 
30 void abuf_init(abuf_t *buf, char *dst, size_t len);
31 
32 void abuf_setnull(abuf_t *buf);
33 
34 char *abuf_push(abuf_t *buf);
35 
36 void abuf_pop(abuf_t *buf, char *end);
37 
38 void abuf_cat(abuf_t *buf, const char *str);
39 
40 int abuf_printf(abuf_t *buf, const char *restrict format, ...);
41 
42 #endif /* INCLUDE_ABUF_H_ */
void abuf_cat(abuf_t *buf, const char *str)
Definition: abuf.c:44
Definition: abuf.h:24
int abuf_printf(abuf_t *buf, const char *restrict format,...)
Definition: abuf.c:54
void abuf_setnull(abuf_t *buf)
Definition: abuf.c:26
void abuf_pop(abuf_t *buf, char *end)
Definition: abuf.c:38
char * head
Definition: abuf.h:25
void abuf_init(abuf_t *buf, char *dst, size_t len)
Definition: abuf.c:19
char * abuf_push(abuf_t *buf)
Definition: abuf.c:33
char * tail
Definition: abuf.h:26
size_t left
Definition: abuf.h:27
struct abuf abuf_t