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.

146 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. * 07-15-01 PML Remove all ALPHA, MIPS, and PPC code
  55. *
  56. ****/
  57. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  58. #pragma once
  59. #endif
  60. #ifndef _INC_MEMORY
  61. #define _INC_MEMORY
  62. #if !defined(_WIN32)
  63. #error ERROR: Only Win32 target supported!
  64. #endif
  65. #ifndef _CRTBLD
  66. /* This version of the header files is NOT for user programs.
  67. * It is intended for use when building the C runtimes ONLY.
  68. * The version intended for public use will not have this message.
  69. */
  70. #error ERROR: Use of C runtime library internal header file.
  71. #endif /* _CRTBLD */
  72. #ifdef __cplusplus
  73. extern "C" {
  74. #endif
  75. #ifndef _INTERNAL_IFSTRIP_
  76. #include <cruntime.h>
  77. #endif /* _INTERNAL_IFSTRIP_ */
  78. #if !defined(_W64)
  79. #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 /*IFSTRIP=IGN*/
  80. #define _W64 __w64
  81. #else
  82. #define _W64
  83. #endif
  84. #endif
  85. /* Define _CRTIMP */
  86. #ifndef _CRTIMP
  87. #ifdef CRTDLL
  88. #define _CRTIMP __declspec(dllexport)
  89. #else /* ndef CRTDLL */
  90. #ifdef _DLL
  91. #define _CRTIMP __declspec(dllimport)
  92. #else /* ndef _DLL */
  93. #define _CRTIMP
  94. #endif /* _DLL */
  95. #endif /* CRTDLL */
  96. #endif /* _CRTIMP */
  97. /* Define __cdecl for non-Microsoft compilers */
  98. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  99. #define __cdecl
  100. #endif
  101. #ifndef _SIZE_T_DEFINED
  102. #ifdef _WIN64
  103. typedef unsigned __int64 size_t;
  104. #else
  105. typedef _W64 unsigned int size_t;
  106. #endif
  107. #define _SIZE_T_DEFINED
  108. #endif
  109. /* Function prototypes */
  110. _CRTIMP void * __cdecl _memccpy(void *, const void *, int, size_t);
  111. _CRTIMP void * __cdecl memchr(const void *, int, size_t);
  112. _CRTIMP int __cdecl _memicmp(const void *, const void *, size_t);
  113. int __cdecl memcmp(const void *, const void *, size_t);
  114. void * __cdecl memcpy(void *, const void *, size_t);
  115. void * __cdecl memset(void *, int, size_t);
  116. #if !__STDC__
  117. /* Non-ANSI names for compatibility */
  118. _CRTIMP void * __cdecl memccpy(void *, const void *, int, size_t);
  119. _CRTIMP int __cdecl memicmp(const void *, const void *, size_t);
  120. #endif /* __STDC__ */
  121. #ifdef __cplusplus
  122. }
  123. #endif
  124. #endif /* _INC_MEMORY */