You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
513 B

/*
* Internal interface definitions for the strbuf abstrction
*
* This header is not part of the public library API and is thus not in
* the public include folder
*/
#ifndef STRBUF_H
#define STRBUF_H 1
typedef struct strbuf {
size_t size;
char str[];
} strbuf_t;
// Initialise the strbuf pointer buf to point at the storage area p
// p must be a known sized object
#define STRBUF_INIT(buf,p) do { \
buf = (void *)p; \
buf->size = sizeof(*p) - sizeof(size_t); \
} while(0)
#endif