diff options
Diffstat (limited to 'usr.sbin/xntpd/include/ntp_string.h')
-rw-r--r-- | usr.sbin/xntpd/include/ntp_string.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/usr.sbin/xntpd/include/ntp_string.h b/usr.sbin/xntpd/include/ntp_string.h index f17905e..cc2eec8 100644 --- a/usr.sbin/xntpd/include/ntp_string.h +++ b/usr.sbin/xntpd/include/ntp_string.h @@ -1,29 +1,35 @@ /* - * Define bcopy, bzero, and bcmp and string op's + * Define string ops: strchr strrchr memcmp memmove memset */ #ifndef _ntp_string_h #define _ntp_string_h -#ifdef NTP_POSIX_SOURCE +#if defined(NTP_POSIX_SOURCE) -#if defined(HAVE_MEMORY_H) -#include <memory.h> -#endif +# if defined(HAVE_MEMORY_H) +# include <memory.h> +# endif -#include <string.h> +# include <string.h> -#define bcopy(s1,s2,n) memcpy(s2, s1, n) -#define bzero(s,n) memset(s, 0, n) -#define bcmp(s1,s2,n) memcmp(s1, s2, n) +#else -#else /* NTP_POSIX_SOURCE */ +# include <strings.h> +# define strchr(s,c) index(s,c) +# define strrchr(s,c) rindex(s,c) +# ifndef NTP_NEED_BOPS +# define NTP_NEED_BOPS +# endif +#endif /* NTP_POSIX_SOURCE */ -#include <strings.h> +#ifdef NTP_NEED_BOPS -#define strrchr rindex -#define strchr index +# define memcmp(a,b,c) bcmp(a,b,c) +# define memmove(t,f,c) bcopy(f,t,c) +# define memset(a,x,c) if (x == 0x00) bzero(a,c); else ntp_memset((char*)a,x,c) +void ntp_memset P((char *, int, int)); -#endif /* NTP_POSIX_SOURCE */ +#endif /* NTP_NEED_BOPS */ #endif /* _ntp_string_h */ |