home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / search.h < prev    next >
C/C++ Source or Header  |  1998-06-17  |  3KB  |  107 lines

  1. /***
  2. *search.h - declarations for searcing/sorting routines
  3. *
  4. *       Copyright (c) 1985-1997, 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. ****/
  14.  
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif  /* _MSC_VER > 1000 */
  18.  
  19. #ifndef _INC_SEARCH
  20. #define _INC_SEARCH
  21.  
  22. #if !defined (_WIN32) && !defined (_MAC)
  23. #error ERROR: Only Mac or Win32 targets supported!
  24. #endif  /* !defined (_WIN32) && !defined (_MAC) */
  25.  
  26. #ifndef _CRTBLD
  27. /* This version of the header files is NOT for user programs.
  28.  * It is intended for use when building the C runtimes ONLY.
  29.  * The version intended for public use will not have this message.
  30.  */
  31. #error ERROR: Use of C runtime library internal header file.
  32. #endif  /* _CRTBLD */
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif  /* __cplusplus */
  37.  
  38. #ifndef _INTERNAL_IFSTRIP_
  39. #include <cruntime.h>
  40. #endif  /* _INTERNAL_IFSTRIP_ */
  41.  
  42.  
  43. /* Define _CRTIMP */
  44.  
  45. #ifndef _CRTIMP
  46. #ifdef CRTDLL
  47. #define _CRTIMP __declspec(dllexport)
  48. #else  /* CRTDLL */
  49. #ifdef _DLL
  50. #define _CRTIMP __declspec(dllimport)
  51. #else  /* _DLL */
  52. #define _CRTIMP
  53. #endif  /* _DLL */
  54. #endif  /* CRTDLL */
  55. #endif  /* _CRTIMP */
  56.  
  57. /* Define __cdecl for non-Microsoft compilers */
  58.  
  59. #if (!defined (_MSC_VER) && !defined (__cdecl))
  60. #define __cdecl
  61. #endif  /* (!defined (_MSC_VER) && !defined (__cdecl)) */
  62.  
  63. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  64.  
  65. #ifndef _CRTAPI1
  66. #if _MSC_VER >= 800 && _M_IX86 >= 300
  67. #define _CRTAPI1 __cdecl
  68. #else  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  69. #define _CRTAPI1
  70. #endif  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  71. #endif  /* _CRTAPI1 */
  72.  
  73.  
  74.  
  75. #ifndef _SIZE_T_DEFINED
  76. typedef unsigned int size_t;
  77. #define _SIZE_T_DEFINED
  78. #endif  /* _SIZE_T_DEFINED */
  79.  
  80.  
  81. /* Function prototypes */
  82.  
  83. _CRTIMP void * __cdecl bsearch(const void *, const void *, size_t, size_t,
  84.         int (__cdecl *)(const void *, const void *));
  85. _CRTIMP void * __cdecl _lfind(const void *, const void *, unsigned int *, unsigned int,
  86.         int (__cdecl *)(const void *, const void *));
  87. _CRTIMP void * __cdecl _lsearch(const void *, void  *, unsigned int *, unsigned int,
  88.         int (__cdecl *)(const void *, const void *));
  89. _CRTIMP void __cdecl qsort(void *, size_t, size_t, int (__cdecl *)(const void *,
  90.         const void *));
  91.  
  92.  
  93. #if !__STDC__
  94. /* Non-ANSI names for compatibility */
  95. _CRTIMP void * __cdecl lfind(const void *, const void *, unsigned int *, unsigned int,
  96.         int (__cdecl *)(const void *, const void *));
  97. _CRTIMP void * __cdecl lsearch(const void *, void  *, unsigned int *, unsigned int,
  98.         int (__cdecl *)(const void *, const void *));
  99. #endif  /* !__STDC__ */
  100.  
  101.  
  102. #ifdef __cplusplus
  103. }
  104. #endif  /* __cplusplus */
  105.  
  106. #endif  /* _INC_SEARCH */
  107.