str.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. //////////////////////////////////////////////////////////////////////////////
  19. //
  20. // str.H
  21. //
  22. // History:
  23. // 05/20/97 JMI Started.
  24. //
  25. //////////////////////////////////////////////////////////////////////////////
  26. //
  27. // Useful, generic string functions that are not ANSI standard.
  28. //
  29. //////////////////////////////////////////////////////////////////////////////
  30. #ifndef STR_H
  31. #define STR_H
  32. //////////////////////////////////////////////////////////////////////////////
  33. // C Headers -- Must be included before RSPiX.h b/c RSPiX utilizes SHMalloc.
  34. //////////////////////////////////////////////////////////////////////////////
  35. ///////////////////////////////////////////////////////////////////////////////
  36. // RSPiX Headers.
  37. // If PATHS_IN_INCLUDES macro is defined, we can utilize relative
  38. // paths to a header file. In this case we generally go off of our
  39. // RSPiX root directory. System.h MUST be included before this macro
  40. // is evaluated. System.h is the header that, based on the current
  41. // platform (or more so in this case on the compiler), defines
  42. // PATHS_IN_INCLUDES. Blue.h includes system.h so you can include that
  43. // instead.
  44. ///////////////////////////////////////////////////////////////////////////////
  45. #include "System.h"
  46. #ifdef PATHS_IN_INCLUDES
  47. #else
  48. #endif
  49. //////////////////////////////////////////////////////////////////////////////
  50. // Macros.
  51. //////////////////////////////////////////////////////////////////////////////
  52. //////////////////////////////////////////////////////////////////////////////
  53. // Protos.
  54. //////////////////////////////////////////////////////////////////////////////
  55. // Perform a lowercase comparison of strings.
  56. // If the strings are equal up to the end of the shorter string, that
  57. // string is lesser.
  58. // Excerpt from VC 5.0 Help on strnicmp():
  59. // "Two strings containing characters located between 'Z' and 'a' in the ASCII
  60. // table ('[', '\', ']', '^', '_', and '`') compare differently, depending on
  61. // their case. For example, the two strings "ABCDE" and "ABCD^" compare one
  62. // way if the comparison is lowercase ("abcde" > "abcd^") and the other way
  63. // ("ABCDE" < "ABCD^") if it is uppercase."
  64. extern short rspStricmp( // Returns 0 if equivalent.
  65. // Returns < 0 if pszStr1 less than pszStr2.
  66. // Returns > 0 if pszStr1 greater than pszStr2.
  67. const char* pszStr1, // In: First string to compare.
  68. const char* pszStr2); // In: Second string to compare.
  69. // Perform a lowercase comparison of strings up to n characters.
  70. // If the shorter string ends before n characters and the strings are
  71. // equal up to the end of the shorter string, that string is lesser.
  72. // Excerpt from VC 5.0 Help on strnicmp():
  73. // "Two strings containing characters located between 'Z' and 'a' in the ASCII
  74. // table ('[', '\', ']', '^', '_', and '`') compare differently, depending on
  75. // their case. For example, the two strings "ABCDE" and "ABCD^" compare one
  76. // way if the comparison is lowercase ("abcde" > "abcd^") and the other way
  77. // ("ABCDE" < "ABCD^") if it is uppercase."
  78. extern short rspStrnicmp( // Returns 0 if equivalent.
  79. // Returns < 0 if pszStr1 less than pszStr2.
  80. // Returns > 0 if pszStr1 greater than pszStr2.
  81. const char* pszStr1, // In: First string to compare.
  82. const char* pszStr2, // In: Second string to compare.
  83. size_t count); // In: Number of characters to compare.
  84. //////////////////////////////////////////////////////////////////////////////
  85. // Typedefs.
  86. //////////////////////////////////////////////////////////////////////////////
  87. #endif // STR_H
  88. //////////////////////////////////////////////////////////////////////////////
  89. // EOF
  90. //////////////////////////////////////////////////////////////////////////////