xref: /freebsd/contrib/ntp/include/ntp_string.h (revision 57718be8fa0bd5edc11ab9a72e68cc71982939a6)
1 /*
2  * Define string ops: strchr strrchr memcmp memmove memset
3  */
4 
5 #ifndef  _ntp_string_h
6 #define  _ntp_string_h
7 
8 #ifdef HAVE_CONFIG_H
9 #include <config.h>
10 #endif
11 
12 #ifdef HAVE_MEMORY_H
13 # include <memory.h>
14 #endif
15 
16 #ifdef HAVE_STRING_H
17 # include <string.h>
18 #endif
19 
20 #ifdef HAVE_BSTRING_H
21 # include <bstring.h>
22 #endif
23 
24 #ifndef STDC_HEADERS
25 # ifndef HAVE_STRCHR
26 #  include <strings.h>
27 #  define strchr index
28 #  define strrchr rindex
29 # endif
30 # ifndef __GNUC__
31 char *strchr(), *strrchr();
32 # endif
33 # ifndef HAVE_MEMCPY
34 #  define NTP_NEED_BOPS
35 # endif
36 #endif /* STDC_HEADERS */
37 
38 #ifdef NTP_NEED_BOPS
39 # define memcmp(a,b,c) bcmp(a,b,(int)c)
40 # define memmove(t,f,c) bcopy(f,t,(int)c)
41 # define memcpy(t,f,c) bcopy(f,t,(int)c)
42 # define memset(a,x,c) if (x == 0x00) bzero(a,(int)c); else ntp_memset((char*)a,x,c)
43 
44 void ntp_memset P((char *, int, int));
45 
46 #endif /*  NTP_NEED_BOPS */
47 
48 #endif /* _ntp_string_h */
49