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.

146 lines
4.7 KiB

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