home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / mem.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  4.0 KB  |  139 lines

  1. /*  mem.h
  2.  
  3.     Memory manipulation functions
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 10.0
  9.  *
  10.  *      Copyright (c) 1987, 2000 by Inprise Corporation
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. /* $Revision:   9.3  $ */
  16.  
  17. #if !defined(__MEM_H)
  18. #define __MEM_H
  19.  
  20. #ifndef ___STDDEF_H
  21. #include <_stddef.h>
  22. #endif
  23.  
  24. #if !defined(RC_INVOKED)
  25.  
  26. #if defined(__STDC__)
  27. #pragma warn -nak
  28. #endif
  29.  
  30. #endif  /* !RC_INVOKED */
  31.  
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. /* Intrinsic functions, defined outside of the namespace */
  38.  
  39. void _FAR * _RTLENTRY  _EXPFUNC16 __memchr__(const void _FAR * __s, int __c, _SIZE_T __n);
  40. int         _RTLENTRY  _EXPFUNC16 __memcmp__(const void _FAR * __s1, const void _FAR * __s2, _SIZE_T __n);
  41. void _FAR * _RTLENTRY  _EXPFUNC16 __memcpy__(void _FAR * __dest, const void _FAR * __src, _SIZE_T __n);
  42. void _FAR * _RTLENTRYF _EXPFUNC16 __memset__(void _FAR * __s, int __c, _SIZE_T __n);
  43.  
  44. #ifdef __cplusplus
  45. namespace std {
  46. #endif
  47.  
  48. void _FAR * _RTLENTRY  _EXPFUNC memccpy(void _FAR *__dest, const void _FAR *__src,
  49.                                         int __c, _SIZE_T __n);
  50. int         _RTLENTRY  _EXPFUNC memcmp(const void _FAR *__s1, const void _FAR *__s2,
  51.                                        _SIZE_T __n);
  52. void _FAR * _RTLENTRY  _EXPFUNC memcpy(void _FAR *__dest, const void _FAR *__src,
  53.                                        _SIZE_T __n);
  54. int         _RTLENTRY  _EXPFUNC memicmp(const void _FAR *__s1, const void _FAR *__s2,
  55.                                         _SIZE_T __n);
  56. void _FAR * _RTLENTRYF _EXPFUNC memmove(void _FAR *__dest, const void _FAR *__src,
  57.                                         _SIZE_T __n);
  58. void _FAR * _RTLENTRYF _EXPFUNC memset(void _FAR *__s, int __c, _SIZE_T __n);
  59.  
  60. void *          _RTLENTRY  _EXPFUNC _wmemset(void *__s, int __c, _SIZE_T __n);
  61. void *          _RTLENTRY  _EXPFUNC _wmemcpy(void *__dest, const void *__src, _SIZE_T __n);
  62.  
  63. #if defined(__cplusplus)
  64. extern "C++"
  65. {
  66.           void _FAR * _RTLENTRY _EXPFUNC32 memchr(void _FAR *__s, int __c, _SIZE_T __n);
  67.     const void _FAR * _RTLENTRY _EXPFUNC32 memchr(const void _FAR *__s, int __c, _SIZE_T __n);
  68.           void      * _RTLENTRY _EXPFUNC32 _wmemchr(void *__s, int __c, _SIZE_T __n);
  69.     const void      * _RTLENTRY _EXPFUNC32 _wmemchr(const void *__s, int __c, _SIZE_T __n);
  70. }
  71. #else
  72.           void _FAR * _RTLENTRY _EXPFUNC32 memchr(const void _FAR *__s, int __c, _SIZE_T __n);
  73.           void      * _RTLENTRY _EXPFUNC32 _wmemchr(const void *__s, int __c, _SIZE_T __n);
  74. #endif
  75.  
  76.  
  77.  
  78. #define movmem(src,dest,length) (void)memmove(dest,src,length)
  79. #define setmem(dest,length,value) (void)memset(dest,value,length)
  80.  
  81. #if !defined(__STDC__) /* NON_ANSI  */
  82. #define _fmemccpy memccpy
  83. #define _fmemchr  memchr
  84. #define _fmemcmp  memcmp
  85. #define _fmemcpy  memcpy
  86. #define _fmemicmp memicmp
  87. #define _fmemmove memmove
  88. #define _fmemset  memset
  89. #define _fmovmem  movmem
  90. #define _fsetmem  setmem
  91. #endif /* __STDC__  */
  92.  
  93. #ifdef __cplusplus
  94. } // std
  95. } // extern "C"
  96. #endif
  97.  
  98. #if !defined(RC_INVOKED)
  99.  
  100. #if defined(__STDC__)
  101. #pragma warn .nak
  102. #endif
  103.  
  104. #endif  /* !RC_INVOKED */
  105.  
  106.  
  107. #endif  /* __MEM_H */
  108.  
  109. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__MEM_H_USING_LIST)
  110. #define __MEM_H_USING_LIST
  111.    using std::_wmemchr;
  112.    using std::_wmemcpy;
  113.    using std::_wmemset;
  114.    using std::memccpy;
  115.    using std::memicmp;
  116.    using std::memmove;
  117.  
  118. /*
  119.    Handle intrinsics specially.  If intrinsics are on, the compiler creates
  120.    a macro of the normal function mapping to the __ intrinsic version, ie:
  121.      #define strcpy __strcpy__
  122.    Thus, we can test the normal name as a macro to see if it's defined, and
  123.    only preform a using statement if it's not an intrinsic
  124. */
  125.  
  126. #  ifndef memchr
  127.      using std::memchr;
  128. #  endif // ifndef memchr
  129. #  ifndef memcmp
  130.      using std::memcmp;
  131. #  endif // ifndef memcmp
  132. #  ifndef memcpy
  133.      using std::memcpy;
  134. #  endif // ifndef memcpy
  135. #  ifndef memset
  136.      using std::memset;
  137. #  endif // ifndef memset
  138.  
  139. #endif /* __USING_CNAME__ */