1ef64b99roberto/*
2047f369cy * Define string ops: strchr strrchr memcmp memmove memset
3ef64b99roberto */
4ef64b99roberto
5047f369cy#ifndef NTP_STRING_H
6047f369cy#define NTP_STRING_H
7ef64b99roberto
8ef64b99roberto#ifdef HAVE_MEMORY_H
9ef64b99roberto# include <memory.h>
10ef64b99roberto#endif
11ef64b99roberto
12ef64b99roberto#ifdef HAVE_STRING_H
13ef64b99roberto# include <string.h>
14ef64b99roberto#endif
15ef64b99roberto
16ef64b99roberto#ifdef HAVE_BSTRING_H
17ef64b99roberto# include <bstring.h>
18ef64b99roberto#endif
19ef64b99roberto
20ef64b99roberto#ifdef NTP_NEED_BOPS
21ef64b99roberto
22d54cfbdroberto#ifdef HAVE_STRINGS_H
23d54cfbdroberto# include <strings.h>		/* bcmp, bcopy, bzero */
24d54cfbdroberto#endif
25d54cfbdroberto
26d54cfbdrobertovoid	ntp_memset	(char *, int, int);
27ef64b99roberto
28d54cfbdroberto#define memcmp(a, b, c)		bcmp(a, b, (int)(c))
29d54cfbdroberto#define memmove(t, f, c)	bcopy(f, t, (int)(c))
30d54cfbdroberto#define memcpy(t, f, c)		bcopy(f, t, (int)(c))
31d54cfbdroberto#define memset(a, x, c)		if (0 == (x)) \
32d54cfbdroberto					bzero(a, (int)(c)); \
33d54cfbdroberto				else \
34d54cfbdroberto					ntp_memset((char *)(a), x, c)
35ef64b99roberto#endif /*  NTP_NEED_BOPS */
36ef64b99roberto
37047f369cy#endif	/* NTP_STRING_H */
38