File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ntp / include / lib_strbuf.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:08:38 2012 UTC (12 years, 4 months ago) by misho
Branches: ntp, MAIN
CVS tags: v4_2_6p5p0, v4_2_6p5, HEAD
ntp 4.2.6p5

    1: /*
    2:  * lib_strbuf.h - definitions for routines which use the common string buffers
    3:  */
    4: 
    5: #include <ntp_types.h>
    6: 
    7: /*
    8:  * Sizes of things
    9:  */
   10: #define	LIB_NUMBUFS	200
   11: #define	LIB_BUFLENGTH	80
   12: 
   13: /*
   14:  * Macro to get a pointer to the next buffer
   15:  */
   16: #define	LIB_GETBUF(buf) \
   17: 	do { \
   18: 		if (!lib_inited) \
   19: 			init_lib(); \
   20: 		buf = &lib_stringbuf[lib_nextbuf][0]; \
   21: 		if (++lib_nextbuf >= LIB_NUMBUFS) \
   22: 			lib_nextbuf = 0; \
   23: 		memset(buf, 0, LIB_BUFLENGTH); \
   24: 	} while (0)
   25: 
   26: extern char lib_stringbuf[LIB_NUMBUFS][LIB_BUFLENGTH];
   27: extern int lib_nextbuf;
   28: extern int lib_inited;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>