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.

92 lines
2.0 KiB

  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. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifndef _INC_SEARCH
  18. #define _INC_SEARCH
  19. #if !defined(_WIN32) && !defined(_MAC)
  20. #error ERROR: Only Mac or Win32 targets supported!
  21. #endif
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Define _CRTIMP */
  26. #ifndef _CRTIMP
  27. #ifdef _DLL
  28. #define _CRTIMP __declspec(dllimport)
  29. #else /* ndef _DLL */
  30. #define _CRTIMP
  31. #endif /* _DLL */
  32. #endif /* _CRTIMP */
  33. /* Define __cdecl for non-Microsoft compilers */
  34. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  35. #define __cdecl
  36. #endif
  37. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  38. #ifndef _CRTAPI1
  39. #if _MSC_VER >= 800 && _M_IX86 >= 300
  40. #define _CRTAPI1 __cdecl
  41. #else
  42. #define _CRTAPI1
  43. #endif
  44. #endif
  45. #ifndef _SIZE_T_DEFINED
  46. typedef unsigned int size_t;
  47. #define _SIZE_T_DEFINED
  48. #endif
  49. /* Function prototypes */
  50. _CRTIMP void * __cdecl bsearch(const void *, const void *, size_t, size_t,
  51. int (__cdecl *)(const void *, const void *));
  52. _CRTIMP void * __cdecl _lfind(const void *, const void *, unsigned int *, unsigned int,
  53. int (__cdecl *)(const void *, const void *));
  54. _CRTIMP void * __cdecl _lsearch(const void *, void *, unsigned int *, unsigned int,
  55. int (__cdecl *)(const void *, const void *));
  56. _CRTIMP void __cdecl qsort(void *, size_t, size_t, int (__cdecl *)(const void *,
  57. const void *));
  58. #if !__STDC__
  59. /* Non-ANSI names for compatibility */
  60. _CRTIMP void * __cdecl lfind(const void *, const void *, unsigned int *, unsigned int,
  61. int (__cdecl *)(const void *, const void *));
  62. _CRTIMP void * __cdecl lsearch(const void *, void *, unsigned int *, unsigned int,
  63. int (__cdecl *)(const void *, const void *));
  64. #endif /* __STDC__ */
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif /* _INC_SEARCH */