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.

151 lines
4.8 KiB

  1. /***
  2. *memory.h - declarations for buffer (memory) manipulation routines
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This include file contains the function declarations for the
  8. * buffer (memory) manipulation routines.
  9. * [System V]
  10. *
  11. * [Public]
  12. *
  13. *Revision History:
  14. * 10/20/87 JCR Removed "MSC40_ONLY" entries
  15. * 12-11-87 JCR Added "_loadds" functionality
  16. * 12-18-87 JCR Added _FAR_ to declarations
  17. * 02-10-88 JCR Cleaned up white space
  18. * 08-22-88 GJF Modified to also work for the 386 (small model only)
  19. * 05-03-89 JCR Added _INTERNAL_IFSTRIP for relinc usage
  20. * 08-03-89 GJF Cleanup, now specific to OS/2 2.0 (i.e., 386 flat model)
  21. * 10-30-89 GJF Fixed copyright
  22. * 11-02-89 JCR Changed "DLL" to "_DLL"
  23. * 11-17-89 GJF Added const to appropriate arg types for memccpy() and
  24. * memicmp().
  25. * 03-01-90 GJF Added #ifndef _INC_MEMORY and #include <cruntime.h>
  26. * stuff. Replace _cdecl with _CALLTYPE1 in prototypes.
  27. * Also, removed some (now) useless preprocessor
  28. * directives.
  29. * 03-21-90 GJF Replaced _cdecl with _CALLTYPE1 in prototypes. Also,
  30. * got rid of movedata() prototype.
  31. * 01-17-91 GJF ANSI naming.
  32. * 08-20-91 JCR C++ and ANSI naming
  33. * 09-28-91 JCR ANSI names: DOSX32=prototypes, WIN32=#defines for now
  34. * 08-05-92 GJF Function calling type and variable type macros.
  35. * 01-21-93 GJF Removed support for C6-386's _cdecl.
  36. * 04-06-93 SKS Replace _CRTAPI1/2 with __cdecl, _CRTVAR1 with nothing
  37. * 04-07-93 SKS Add _CRTIMP keyword for CRT DLL model
  38. * Use link-time aliases for old names, not #define's
  39. * Intrinsic functions cannot use __declspec(dllimport)
  40. * 10-11-93 GJF Merged Cuda and NT versions.
  41. * 02-11-95 CFW Add _CRTBLD to avoid users getting wrong headers.
  42. * 02-14-95 CFW Clean up Mac merge.
  43. * 03-10-95 BWT add _CRTIMP to MIPS intrinsics
  44. * 12-14-95 JWM Add "#pragma once".
  45. * 02-05-97 GJF Deleted obsolete support for _CRTAPI* and _NTSDK.
  46. * 09-30-97 JWM Restored not-so-obsolete _CRTAPI1 support.
  47. * 10-07-97 RDL Added IA64.
  48. * 12-15-98 GJF Changes for 64-bit size_t.
  49. * 05-13-99 PML Remove _CRTAPI1
  50. * 05-17-99 PML Remove all Macintosh support.
  51. * 10-06-99 PML Add _W64 modifier to types which are 32 bits in Win32,
  52. * 64 bits in Win64.
  53. * 10-27-99 PML unsigned int -> size_t in memccpy, memicmp
  54. *
  55. ****/
  56. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  57. #pragma once
  58. #endif
  59. #ifndef _INC_MEMORY
  60. #define _INC_MEMORY
  61. #if !defined(_WIN32)
  62. #error ERROR: Only Win32 target supported!
  63. #endif
  64. #ifndef _CRTBLD
  65. /* This version of the header files is NOT for user programs.
  66. * It is intended for use when building the C runtimes ONLY.
  67. * The version intended for public use will not have this message.
  68. */
  69. #error ERROR: Use of C runtime library internal header file.
  70. #endif /* _CRTBLD */
  71. #ifdef __cplusplus
  72. extern "C" {
  73. #endif
  74. #ifndef _INTERNAL_IFSTRIP_
  75. #include <cruntime.h>
  76. #endif /* _INTERNAL_IFSTRIP_ */
  77. #if !defined(_W64)
  78. #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 /*IFSTRIP=IGN*/
  79. #define _W64 __w64
  80. #else
  81. #define _W64
  82. #endif
  83. #endif
  84. /* Define _CRTIMP */
  85. #ifndef _CRTIMP
  86. #ifdef CRTDLL
  87. #define _CRTIMP __declspec(dllexport)
  88. #else /* ndef CRTDLL */
  89. #ifdef _DLL
  90. #define _CRTIMP __declspec(dllimport)
  91. #else /* ndef _DLL */
  92. #define _CRTIMP
  93. #endif /* _DLL */
  94. #endif /* CRTDLL */
  95. #endif /* _CRTIMP */
  96. /* Define __cdecl for non-Microsoft compilers */
  97. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  98. #define __cdecl
  99. #endif
  100. #ifndef _SIZE_T_DEFINED
  101. #ifdef _WIN64
  102. typedef unsigned __int64 size_t;
  103. #else
  104. typedef _W64 unsigned int size_t;
  105. #endif
  106. #define _SIZE_T_DEFINED
  107. #endif
  108. /* Function prototypes */
  109. _CRTIMP void * __cdecl _memccpy(void *, const void *, int, size_t);
  110. _CRTIMP void * __cdecl memchr(const void *, int, size_t);
  111. _CRTIMP int __cdecl _memicmp(const void *, const void *, size_t);
  112. #ifdef _M_MRX000
  113. _CRTIMP int __cdecl memcmp(const void *, const void *, size_t);
  114. _CRTIMP void * __cdecl memcpy(void *, const void *, size_t);
  115. _CRTIMP void * __cdecl memset(void *, int, size_t);
  116. #else
  117. int __cdecl memcmp(const void *, const void *, size_t);
  118. void * __cdecl memcpy(void *, const void *, size_t);
  119. void * __cdecl memset(void *, int, size_t);
  120. #endif
  121. #if !__STDC__
  122. /* Non-ANSI names for compatibility */
  123. _CRTIMP void * __cdecl memccpy(void *, const void *, int, size_t);
  124. _CRTIMP int __cdecl memicmp(const void *, const void *, size_t);
  125. #endif /* __STDC__ */
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129. #endif /* _INC_MEMORY */