searchh.inc 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. type
  2. Pqelem = ^qelem;
  3. qelem = record
  4. q_forw : Pqelem;
  5. q_back : Pqelem;
  6. q_data : array[0..0] of char;
  7. end;
  8. procedure insque(__elem:pointer; __prev:pointer);cdecl;external clib name 'insque';
  9. procedure remque(__elem:pointer);cdecl;external clib name 'remque';
  10. type
  11. // __compar_fn_t = function (_para1:pointer; _para2:pointer):longint;cdecl;
  12. Pcomparison_fn_t = ^comparison_fn_t;
  13. // comparison_fn_t = __compar_fn_t;
  14. type
  15. hsearch_ACTION = (FIND, ENTER);
  16. PACTION = ^ACTION;
  17. ACTION = Longint;
  18. { Pentry = ^entry;
  19. entry = record
  20. key : Pchar;
  21. data : pointer;
  22. end;
  23. }
  24. Phsearch_ENTRY = ^hsearch_ENTRY;
  25. hsearch_ENTRY = record
  26. {undefined structure}
  27. end;
  28. PPhsearch_ENTRY = ^Phsearch_ENTRY;
  29. function hsearch(__item:hsearch_ENTRY; __action:hsearch_ACTION):Phsearch_ENTRY;cdecl;external clib name 'hsearch';
  30. function hcreate(__nel:size_t):longint;cdecl;external clib name 'hcreate';
  31. procedure hdestroy;cdecl;external clib name 'hdestroy';
  32. type
  33. Phsearch_data = ^hsearch_data;
  34. hsearch_data = record
  35. table : Phsearch_ENTRY;
  36. size : dword;
  37. filled : dword;
  38. end;
  39. function hsearch_r(__item:hsearch_ENTRY; __action:hsearch_ACTION; __retval:PPhsearch_ENTRY; __htab:Phsearch_data):longint;cdecl;external clib name 'hsearch_r';
  40. function hcreate_r(__nel:size_t; __htab:Phsearch_data):longint;cdecl;external clib name 'hcreate_r';
  41. procedure hdestroy_r(__htab:Phsearch_data);cdecl;external clib name 'hdestroy_r';
  42. type
  43. PSearch_VISIT = ^tsearch_VISIT;
  44. tsearch_VISIT = (preorder, postorder, endorder, leaf);
  45. function tsearch(__key:pointer; __rootp:Ppointer; __compar:__compar_fn_t):pointer;cdecl;external clib name 'tsearch';
  46. function tfind(__key:pointer; __rootp:Ppointer; __compar:__compar_fn_t):pointer;cdecl;external clib name 'tfind';
  47. function tdelete(__key:pointer; __rootp:Ppointer; __compar:__compar_fn_t):pointer;cdecl;external clib name 'tdelete';
  48. type
  49. __action_fn_t = procedure (__nodep:pointer; __value:tsearch_VISIT; __level:longint);cdecl;
  50. procedure twalk(__root:pointer; __action:__action_fn_t);cdecl;external clib name 'twalk';
  51. type
  52. __free_fn_t = procedure (__nodep:pointer);cdecl;
  53. procedure tdestroy(__root:pointer; __freefct:__free_fn_t);cdecl;external clib name 'tdestroy';
  54. function lfind(__key:pointer; __base:pointer; __nmemb:Psize_t; __size:size_t; __compar:__compar_fn_t):pointer;cdecl;external clib name 'lfind';
  55. function lsearch(__key:pointer; __base:pointer; __nmemb:Psize_t; __size:size_t; __compar:__compar_fn_t):pointer;cdecl;external clib name 'lsearch';
  56. { ---------------------------------------------------------------------
  57. Borland compatibility types
  58. ---------------------------------------------------------------------}
  59. Type
  60. PQElement = ^TQElement;
  61. TQElement = qelem;
  62. THSearchEntry = hsearch_ENTRY;
  63. PHSearchEntry = ^THSearchEntry;
  64. THSearchEntryOpaque = hsearch_ENTRY;
  65. PHSearchEntryOpaque = ^THSearchEntryOpaque;
  66. function hsearch_r(__item:hsearch_ENTRY; __action:hsearch_ACTION; var __retval:Phsearch_ENTRY; __htab:Phsearch_data):longint;cdecl;external clib name 'hsearch_r';
  67. function tsearch(__key:pointer; var __rootp:pointer; __compar:__compar_fn_t):pointer;cdecl;external clib name 'tsearch';
  68. function tfind(__key:pointer; var __rootp:pointer; __compar:__compar_fn_t):pointer;cdecl;external clib name 'tfind';
  69. function tdelete(__key:pointer; var __rootp:pointer; __compar:__compar_fn_t):pointer;cdecl;external clib name 'tdelete';