search.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _INC_SEARCH
  7. #define _INC_SEARCH
  8. #include <crtdefs.h>
  9. #include <stddef.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #ifndef _CRT_ALGO_DEFINED
  14. #define _CRT_ALGO_DEFINED
  15. void *__cdecl bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
  16. void __cdecl qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
  17. #endif
  18. _CRTIMP void *__cdecl _lfind(const void *_Key,const void *_Base,unsigned int *_NumOfElements,unsigned int _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
  19. _CRTIMP void *__cdecl _lsearch(const void *_Key,void *_Base,unsigned int *_NumOfElements,unsigned int _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
  20. #ifndef NO_OLDNAMES
  21. void *__cdecl lfind(const void *_Key,const void *_Base,unsigned int *_NumOfElements,unsigned int _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
  22. void *__cdecl lsearch(const void *_Key,void *_Base,unsigned int *_NumOfElements,unsigned int _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
  23. #endif
  24. /*
  25. Documentation for these POSIX definitions and prototypes can be found in
  26. The Open Group Base Specifications Issue 6
  27. IEEE Std 1003.1, 2004 Edition.
  28. eg: http://www.opengroup.org/onlinepubs/009695399/functions/twalk.html
  29. */
  30. typedef struct entry {
  31. char *key;
  32. void *data;
  33. } ENTRY;
  34. typedef enum {
  35. FIND,
  36. ENTER
  37. } ACTION;
  38. typedef enum {
  39. preorder,
  40. postorder,
  41. endorder,
  42. leaf
  43. } VISIT;
  44. #ifdef _SEARCH_PRIVATE
  45. typedef struct node {
  46. char *key;
  47. struct node *llink, *rlink;
  48. } node_t;
  49. #endif
  50. void * __cdecl tdelete (const void * __restrict__, void ** __restrict__, int (*)(const void *, const void *)) __MINGW_ATTRIB_NONNULL (2) __MINGW_ATTRIB_NONNULL (3);
  51. void * __cdecl tfind (const void *, void * const *, int (*)(const void *, const void *)) __MINGW_ATTRIB_NONNULL (2) __MINGW_ATTRIB_NONNULL (3);
  52. void * __cdecl tsearch (const void *, void **, int (*)(const void *, const void *)) __MINGW_ATTRIB_NONNULL (2) __MINGW_ATTRIB_NONNULL (3);
  53. void __cdecl twalk (const void *, void (*)(const void *, VISIT, int));
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #include <sec_api/search_s.h>
  58. #endif