Leaked source code of windows server 2003
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.

92 lines
2.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. // File: uastrfnc.h
  7. //
  8. // Contents: Unaligned UNICODE lstr functions for MIPS, PPC, ALPHA, ...
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. //;begin_internal
  15. // History: 1-11-95 davepl Created
  16. //;end_internal
  17. //
  18. //--------------------------------------------------------------------------
  19. // NOTE: This file assumes it is included from shellprv.h
  20. #ifndef _UASTRFNC_H_
  21. #define _UASTRFNC_H_
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. // If we are running on a platform that requires aligned data, we need
  26. // to provide custom string functions that can deal with unaligned
  27. // strings. On other platforms, these call directly to the normal string
  28. // functions.
  29. #ifndef _X86_
  30. #define ALIGNMENT_MACHINE
  31. #endif
  32. #ifdef ALIGNMENT_MACHINE
  33. #define IS_ALIGNED(p) (((ULONG_PTR)(p) & (sizeof(*(p))-1) )==0)
  34. UNALIGNED WCHAR * ualstrcpynW(UNALIGNED WCHAR * lpString1,
  35. UNALIGNED const WCHAR * lpString2,
  36. int iMaxLength);
  37. int ualstrcmpiW (UNALIGNED const WCHAR * dst,
  38. UNALIGNED const WCHAR * src);
  39. int ualstrcmpW (UNALIGNED const WCHAR * src,
  40. UNALIGNED const WCHAR * dst);
  41. size_t ualstrlenW (UNALIGNED const WCHAR * wcs);
  42. UNALIGNED WCHAR * ualstrcpyW (UNALIGNED WCHAR * dst,
  43. UNALIGNED const WCHAR * src);
  44. #else
  45. #define ualstrcpynW StrCpyNW // lstrcpynW is stubbed out on Windows 95
  46. #define ualstrcmpiW StrCmpIW // lstrcmpiW is stubbed out on Windows 95
  47. #define ualstrcmpW StrCmpW // lstrcmpW is stubbed out on Windows 95
  48. #define ualstrlenW lstrlenW
  49. #define ualstrcpyW StrCpyW // lstrcpyW is stubbed out on Windows 95
  50. #endif // ALIGNMENT_MACHINE
  51. #define ualstrcpynA lstrcpynA
  52. #define ualstrcmpiA lstrcmpiA
  53. #define ualstrcmpA lstrcmpA
  54. #define ualstrlenA lstrlenA
  55. #define ualstrcpyA lstrcpyA
  56. #ifdef UNICODE
  57. #define ualstrcpyn ualstrcpynW
  58. #define ualstrcmpi ualstrcmpiW
  59. #define ualstrcmp ualstrcmpW
  60. #define ualstrlen ualstrlenW
  61. #define ualstrcpy ualstrcpyW
  62. #else
  63. #define ualstrcpyn ualstrcpynA
  64. #define ualstrcmpi ualstrcmpiA
  65. #define ualstrcmp ualstrcmpA
  66. #define ualstrlen ualstrlenA
  67. #define ualstrcpy ualstrcpyA
  68. #endif
  69. #ifdef __cplusplus
  70. } // extern "C"
  71. #endif
  72. #endif // _UASTRFNC_H_