home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / uastrfnc.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  2KB  |  86 lines

  1. //+-------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright 1994 - 1998 Microsoft Corporation.
  5. //
  6. //  File:       uastrfnc.h
  7. //
  8. //  Contents:   Unaligned UNICODE lstr functions for MIPS, PPC, ALPHA, ...
  9. //
  10. //  Classes:
  11. //
  12. //  Functions:
  13. //
  14. //--------------------------------------------------------------------------
  15.  
  16. // NOTE: This file assumes it is included from shellprv.h
  17.  
  18. #ifndef _UASTRFNC_H_
  19. #define _UASTRFNC_H_
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  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.  
  30. #ifndef _X86_
  31. #define ALIGNMENT_MACHINE
  32. #endif
  33.  
  34. #ifdef ALIGNMENT_MACHINE
  35.  
  36. UNALIGNED WCHAR * ualstrcpynW(UNALIGNED WCHAR * lpString1,
  37.                         UNALIGNED const WCHAR * lpString2,
  38.                       int iMaxLength);
  39.  
  40. int           ualstrcmpiW (UNALIGNED const WCHAR * dst,
  41.                    UNALIGNED const WCHAR * src);
  42.  
  43. int           ualstrcmpW  (UNALIGNED const WCHAR * src,
  44.                    UNALIGNED const WCHAR * dst);
  45.  
  46. size_t           ualstrlenW  (UNALIGNED const WCHAR * wcs);
  47.  
  48. UNALIGNED WCHAR * ualstrcpyW  (UNALIGNED WCHAR * dst,
  49.                    UNALIGNED const WCHAR * src);
  50.  
  51. #else
  52.  
  53. #define ualstrcpynW StrCpyNW     // lstrcpynW is stubbed out on Windows 95
  54. #define ualstrcmpiW StrCmpIW     // lstrcmpiW is stubbed out on Windows 95
  55. #define ualstrcmpW  StrCmpW      // lstrcmpW is stubbed out on Windows 95
  56. #define ualstrlenW  lstrlenW
  57. #define ualstrcpyW  StrCpyW      // lstrcpyW is stubbed out on Windows 95
  58.  
  59. #endif // ALIGNMENT_MACHINE
  60.  
  61. #define ualstrcpynA lstrcpynA
  62. #define ualstrcmpiA lstrcmpiA
  63. #define ualstrcmpA  lstrcmpA
  64. #define ualstrlenA  lstrlenA
  65. #define ualstrcpyA  lstrcpyA
  66.  
  67. #ifdef UNICODE
  68. #define ualstrcpyn ualstrcpynW
  69. #define ualstrcmpi ualstrcmpiW
  70. #define ualstrcmp  ualstrcmpW
  71. #define ualstrlen  ualstrlenW
  72. #define ualstrcpy  ualstrcpyW
  73. #else
  74. #define ualstrcpyn ualstrcpynA
  75. #define ualstrcmpi ualstrcmpiA
  76. #define ualstrcmp  ualstrcmpA
  77. #define ualstrlen  ualstrlenA
  78. #define ualstrcpy  ualstrcpyA
  79. #endif
  80.  
  81. #ifdef __cplusplus
  82. }       // extern "C"
  83. #endif
  84.  
  85. #endif // _UASTRFNC_H_
  86.