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.

112 lines
2.3 KiB

  1. /***
  2. *search.h - declarations for searcing/sorting routines
  3. *
  4. * Copyright (c) 1985-1995, 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. #ifndef _INC_SEARCH
  15. #define _INC_SEARCH
  16. #if !defined(_WIN32) && !defined(_MAC)
  17. #error ERROR: Only Mac or Win32 targets supported!
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  23. #ifndef _CRTAPI1
  24. #if _MSC_VER >= 800 && _M_IX86 >= 300
  25. #define _CRTAPI1 __cdecl
  26. #else
  27. #define _CRTAPI1
  28. #endif
  29. #endif
  30. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  31. #ifndef _CRTAPI2
  32. #if _MSC_VER >= 800 && _M_IX86 >= 300
  33. #define _CRTAPI2 __cdecl
  34. #else
  35. #define _CRTAPI2
  36. #endif
  37. #endif
  38. /* Define _CRTIMP */
  39. #ifndef _CRTIMP
  40. #ifdef _NTSDK
  41. /* definition compatible with NT SDK */
  42. #define _CRTIMP
  43. #else /* ndef _NTSDK */
  44. /* current definition */
  45. #ifdef _DLL
  46. #define _CRTIMP __declspec(dllimport)
  47. #else /* ndef _DLL */
  48. #define _CRTIMP
  49. #endif /* _DLL */
  50. #endif /* _NTSDK */
  51. #endif /* _CRTIMP */
  52. /* Define __cdecl for non-Microsoft compilers */
  53. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  54. #define __cdecl
  55. #endif
  56. #ifndef _SIZE_T_DEFINED
  57. typedef unsigned int size_t;
  58. #define _SIZE_T_DEFINED
  59. #endif
  60. /* Function prototypes */
  61. _CRTIMP void * __cdecl bsearch(const void *, const void *, size_t, size_t,
  62. int (__cdecl *)(const void *, const void *));
  63. _CRTIMP void * __cdecl _lfind(const void *, const void *, unsigned int *, unsigned int,
  64. int (__cdecl *)(const void *, const void *));
  65. _CRTIMP void * __cdecl _lsearch(const void *, void *, unsigned int *, unsigned int,
  66. int (__cdecl *)(const void *, const void *));
  67. _CRTIMP void __cdecl qsort(void *, size_t, size_t, int (__cdecl *)(const void *,
  68. const void *));
  69. #if !__STDC__
  70. /* Non-ANSI names for compatibility */
  71. #ifdef _NTSDK
  72. /* definitions compatible with NT SDK */
  73. #define lfind _lfind
  74. #define lsearch _lsearch
  75. #else /* ndef _NTSDK */
  76. /* current declarations */
  77. _CRTIMP void * __cdecl lfind(const void *, const void *, unsigned int *, unsigned int,
  78. int (__cdecl *)(const void *, const void *));
  79. _CRTIMP void * __cdecl lsearch(const void *, void *, unsigned int *, unsigned int,
  80. int (__cdecl *)(const void *, const void *));
  81. #endif /* _NTSDK */
  82. #endif /* __STDC__ */
  83. #ifdef __cplusplus
  84. }
  85. #endif
  86. #endif /* _INC_SEARCH */