Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.7 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. uinetlib.h
  7. Replacement netlib.h
  8. This file redirects netlib.h to string.h. NETLIB.H is a LANMAN
  9. include file for which STRING.H is the nearest equivalent. The
  10. directory containing this file should only be on the include path for NT.
  11. We place several macros here to allow the "f" variants to be used.
  12. FILE HISTORY:
  13. jonn 12-Sep-1991 Added to $(UI)\common\h\nt
  14. beng 22-Oct-1991 Patch for NT c runtimes
  15. beng 09-Mar-1992 Add Unicode versions
  16. beng 28-Mar-1992 More Unicode versions
  17. beng 07-May-1992 Use correct wcs include and names
  18. KeithMo 12-Dec-1992 Moved to common\h, renamed to uinetlib.h
  19. to avoid conflict with net\inc\netlib.h.
  20. jonn 25-Mar-1993 ITG special sort
  21. jonn 02-Feb-1994 Added NETUI_strncmp2 and NETUI_strnicmp2
  22. */
  23. #ifndef NETUI_UINETLIB
  24. #define NETUI_UINETLIB
  25. #if defined(__cplusplus)
  26. extern "C"
  27. {
  28. #endif
  29. void InitCompareParam( void );
  30. DWORD QueryStdCompareParam( void );
  31. DWORD QueryNocaseCompareParam( void );
  32. DWORD QueryUserDefaultLCID( void ); // actually an LCID
  33. DLL_BASED
  34. INT NETUI_strcmp( const WCHAR * pchString1, const WCHAR * pchString2 );
  35. DLL_BASED
  36. INT NETUI_stricmp( const WCHAR * pchString1, const WCHAR * pchString2 );
  37. DLL_BASED
  38. INT NETUI_strncmp( const WCHAR * pchString1, const WCHAR * pchString2, INT cch );
  39. DLL_BASED
  40. INT NETUI_strnicmp( const WCHAR * pchString1, const WCHAR * pchString2, INT cch );
  41. /*
  42. NETUI_strncmp2 and NETUI_strncmp2 allow you to compare two strings
  43. of fixed but different lengths. This is important where the strings
  44. might compare '-', and cutting "X-Y" to "X-" might have undesirable
  45. effects on sort order without SORT_STRINGSORT (see ::CompareStringW).
  46. BEWARE of using NETUI_strncmp and NETUI_strnicmp without understanding
  47. this behavior! The same applies to strncmp() and strnicmp().
  48. */
  49. DLL_BASED
  50. INT NETUI_strncmp2( const WCHAR * pchString1, INT cch1,
  51. const WCHAR * pchString2, INT cch2 );
  52. DLL_BASED
  53. INT NETUI_strnicmp2( const WCHAR * pchString1, INT cch1,
  54. const WCHAR * pchString2, INT cch2 );
  55. #define memcmpf memcmp
  56. #define memcpyf memcpy
  57. #define memmovef memmove
  58. #define memsetf memset
  59. #if defined(UNICODE)
  60. #define strcatf wcscat
  61. #define strchrf wcschr
  62. #define strcmpf(x,y) NETUI_strcmp(x,y)
  63. #define stricmpf(x,y) NETUI_stricmp(x,y)
  64. #define strcpyf wcscpy
  65. #define strcspnf wcscspn
  66. #define strlenf wcslen
  67. #define strlwrf _wcslwr
  68. #define strncatf wcsncat
  69. #define strncmpf(x,y,n) NETUI_strncmp(x,y,n)
  70. #define strnicmpf(x,y,n) NETUI_strnicmp(x,y,n)
  71. #define strncpyf wcsncpy
  72. #define strpbrkf wcspbrk
  73. #define strrchrf wcsrchr
  74. #define strrevf _wcsrev
  75. #define strspnf wcsspn
  76. #define strstrf wcsstr
  77. //#define strtokf strtok - This function is not available under Unicode
  78. #define struprf _wcsupr
  79. #else
  80. #define strcatf strcat
  81. #define strchrf strchr
  82. #define strcmpf strcmp
  83. #define stricmpf _stricmp
  84. #define strcpyf strcpy
  85. #define strcspnf strcspn
  86. #define strlenf strlen
  87. #define strlwrf _strlwr
  88. #define strncatf strncat
  89. #define strncmpf strncmp
  90. #define strnicmpf _strnicmp
  91. #define strncpyf strncpy
  92. #define strpbrkf strpbrk
  93. #define strrchrf strrchr
  94. #define strrevf _strrev
  95. #define strspnf strspn
  96. #define strstrf strstr
  97. #define strtokf strtok
  98. #define struprf _strupr
  99. #endif
  100. #define nprintf printf
  101. #if defined(__cplusplus)
  102. }
  103. #endif
  104. #if defined(UNICODE)
  105. #include <wchar.h>
  106. #else
  107. #include <string.h>
  108. #endif
  109. #endif