opnsense-src/contrib/ntp/include/lib_strbuf.h
Cy Schubert f9b7261632 ntp: Vendor import of ntp-4.2.8p18
Merge commit '1f833b3fc9968c3dd7ed79ccf0525ebf16c891ad' into main

(cherry picked from commit f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
2024-05-29 18:42:19 -07:00

32 lines
768 B
C

/*
* lib_strbuf.h - definitions for routines which use the common string buffers
*/
#ifndef LIB_STRBUF_H
#define LIB_STRBUF_H
#include <ntp_types.h>
#include <ntp_malloc.h> /* for zero_mem() */
#define LIB_BUFLENGTH 128
extern int lib_inited;
extern int ipv4_works;
extern int ipv6_works;
extern void init_lib(void);
/*
* Get a pointer to the next string buffer of LIB_BUFLENGTH octets.
* New and modified code should use buf = lib_getbuf() directly to
* provide clarity for folks familiar with common C style, but there's
* no need to churn the history with a mechanical switch away from
* LIB_GETBUF(buf).
*/
extern char* lib_getbuf(void);
#define LIB_GETBUF(bufp) \
do { \
(bufp) = lib_getbuf(); \
} while (FALSE)
#endif /* LIB_STRBUF_H */