12b15cb3dSCy Schubert /* 22b15cb3dSCy Schubert * lib_strbuf.h - definitions for routines which use the common string buffers 32b15cb3dSCy Schubert */ 42b15cb3dSCy Schubert #ifndef LIB_STRBUF_H 52b15cb3dSCy Schubert #define LIB_STRBUF_H 62b15cb3dSCy Schubert 72b15cb3dSCy Schubert #include <ntp_types.h> 8*f5f40dd6SCy Schubert #include <ntp_malloc.h> /* for zero_mem() */ 92b15cb3dSCy Schubert 102b15cb3dSCy Schubert #define LIB_BUFLENGTH 128 112b15cb3dSCy Schubert 122b15cb3dSCy Schubert extern int lib_inited; 13*f5f40dd6SCy Schubert extern int ipv4_works; 14*f5f40dd6SCy Schubert extern int ipv6_works; 152b15cb3dSCy Schubert 16*f5f40dd6SCy Schubert extern void init_lib(void); 172b15cb3dSCy Schubert 182b15cb3dSCy Schubert /* 19*f5f40dd6SCy Schubert * Get a pointer to the next string buffer of LIB_BUFLENGTH octets. 20*f5f40dd6SCy Schubert * New and modified code should use buf = lib_getbuf() directly to 21*f5f40dd6SCy Schubert * provide clarity for folks familiar with common C style, but there's 22*f5f40dd6SCy Schubert * no need to churn the history with a mechanical switch away from 23*f5f40dd6SCy Schubert * LIB_GETBUF(buf). 242b15cb3dSCy Schubert */ 25*f5f40dd6SCy Schubert extern char* lib_getbuf(void); 26*f5f40dd6SCy Schubert 272b15cb3dSCy Schubert #define LIB_GETBUF(bufp) \ 282b15cb3dSCy Schubert do { \ 29*f5f40dd6SCy Schubert (bufp) = lib_getbuf(); \ 302b15cb3dSCy Schubert } while (FALSE) 312b15cb3dSCy Schubert 322b15cb3dSCy Schubert #endif /* LIB_STRBUF_H */ 33