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.

105 lines
2.2 KiB

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