/contrib/ntp/include/ntp_string.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 48 lines · 35 code · 10 blank · 3 comment · 3 complexity · 8afe49e936ca3f729a54f309c00f7117 MD5 · raw file

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