Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / ntp / dist / include / lib_strbuf.h
blobcf9bc4edf2d55d1ed3eb337e02831e1cb1715f2e
1 /* $NetBSD$ */
3 /*
4 * lib_strbuf.h - definitions for routines which use the common string buffers
5 */
7 #include <ntp_types.h>
9 /*
10 * Sizes of things
12 #define LIB_NUMBUFS 200
13 #define LIB_BUFLENGTH 80
16 * Macro to get a pointer to the next buffer
18 #define LIB_GETBUF(buf) \
19 do { \
20 if (!lib_inited) \
21 init_lib(); \
22 buf = &lib_stringbuf[lib_nextbuf][0]; \
23 if (++lib_nextbuf >= LIB_NUMBUFS) \
24 lib_nextbuf = 0; \
25 memset(buf, 0, LIB_BUFLENGTH); \
26 } while (0)
28 extern char lib_stringbuf[LIB_NUMBUFS][LIB_BUFLENGTH];
29 extern int lib_nextbuf;
30 extern int lib_inited;