String.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
  3. #ifndef cmsys_String_h
  4. #define cmsys_String_h
  5. #include <cmsys/Configure.h>
  6. #include <stddef.h> /* size_t */
  7. /* Redefine all public interface symbol names to be in the proper
  8. namespace. These macros are used internally to kwsys only, and are
  9. not visible to user code. Use kwsysHeaderDump.pl to reproduce
  10. these macros after making changes to the interface. */
  11. #if !defined(KWSYS_NAMESPACE)
  12. #define kwsys_ns(x) cmsys##x
  13. #define kwsysEXPORT cmsys_EXPORT
  14. #endif
  15. #if !cmsys_NAME_IS_KWSYS
  16. #define kwsysString_strcasecmp kwsys_ns(String_strcasecmp)
  17. #define kwsysString_strncasecmp kwsys_ns(String_strncasecmp)
  18. #endif
  19. #if defined(__cplusplus)
  20. extern "C" {
  21. #endif
  22. /**
  23. * Compare two strings ignoring the case of the characters. The
  24. * integer returned is negative, zero, or positive if the first string
  25. * is found to be less than, equal to, or greater than the second
  26. * string, respectively.
  27. */
  28. kwsysEXPORT int kwsysString_strcasecmp(const char* lhs, const char* rhs);
  29. /**
  30. * Identical to String_strcasecmp except that only the first n
  31. * characters are considered.
  32. */
  33. kwsysEXPORT int kwsysString_strncasecmp(const char* lhs, const char* rhs,
  34. size_t n);
  35. #if defined(__cplusplus)
  36. } /* extern "C" */
  37. #endif
  38. /* If we are building a kwsys .c or .cxx file, let it use these macros.
  39. Otherwise, undefine them to keep the namespace clean. */
  40. #if !defined(KWSYS_NAMESPACE)
  41. #undef kwsys_ns
  42. #undef kwsysEXPORT
  43. #if !cmsys_NAME_IS_KWSYS
  44. #undef kwsysString_strcasecmp
  45. #undef kwsysString_strncasecmp
  46. #endif
  47. #endif
  48. #endif