home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / search.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  2KB  |  93 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
  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
  25.  
  26.  
  27. #ifdef  __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31.  
  32.  
  33. /* Define _CRTIMP */
  34.  
  35. #ifndef _CRTIMP
  36. #ifdef  _DLL
  37. #define _CRTIMP __declspec(dllimport)
  38. #else   /* ndef _DLL */
  39. #define _CRTIMP
  40. #endif  /* _DLL */
  41. #endif  /* _CRTIMP */
  42.  
  43. /* Define __cdecl for non-Microsoft compilers */
  44.  
  45. #if     ( !defined(_MSC_VER) && !defined(__cdecl) )
  46. #define __cdecl
  47. #endif
  48.  
  49. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  50.  
  51. #ifndef _CRTAPI1
  52. #if    _MSC_VER >= 800 && _M_IX86 >= 300
  53. #define _CRTAPI1 __cdecl
  54. #else
  55. #define _CRTAPI1
  56. #endif
  57. #endif
  58.  
  59.  
  60.  
  61. #ifndef _SIZE_T_DEFINED
  62. typedef unsigned int size_t;
  63. #define _SIZE_T_DEFINED
  64. #endif
  65.  
  66.  
  67. /* Function prototypes */
  68.  
  69. _CRTIMP void * __cdecl bsearch(const void *, const void *, size_t, size_t,
  70.         int (__cdecl *)(const void *, const void *));
  71. _CRTIMP void * __cdecl _lfind(const void *, const void *, unsigned int *, unsigned int,
  72.         int (__cdecl *)(const void *, const void *));
  73. _CRTIMP void * __cdecl _lsearch(const void *, void  *, unsigned int *, unsigned int,
  74.         int (__cdecl *)(const void *, const void *));
  75. _CRTIMP void __cdecl qsort(void *, size_t, size_t, int (__cdecl *)(const void *,
  76.         const void *));
  77.  
  78.  
  79. #if     !__STDC__
  80. /* Non-ANSI names for compatibility */
  81. _CRTIMP void * __cdecl lfind(const void *, const void *, unsigned int *, unsigned int,
  82.         int (__cdecl *)(const void *, const void *));
  83. _CRTIMP void * __cdecl lsearch(const void *, void  *, unsigned int *, unsigned int,
  84.         int (__cdecl *)(const void *, const void *));
  85. #endif  /* __STDC__ */
  86.  
  87.  
  88. #ifdef  __cplusplus
  89. }
  90. #endif
  91.  
  92. #endif  /* _INC_SEARCH */
  93.