globh.inc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. Const
  2. GLOB_ERR = 1 shl 0;
  3. GLOB_MARK = 1 shl 1;
  4. GLOB_NOSORT = 1 shl 2;
  5. GLOB_DOOFFS = 1 shl 3;
  6. GLOB_NOCHECK = 1 shl 4;
  7. GLOB_APPEND = 1 shl 5;
  8. GLOB_NOESCAPE = 1 shl 6;
  9. GLOB_PERIOD = 1 shl 7;
  10. GLOB_MAGCHAR = 1 shl 8;
  11. GLOB_ALTDIRFUNC = 1 shl 9;
  12. GLOB_BRACE = 1 shl 10;
  13. GLOB_NOMAGIC = 1 shl 11;
  14. GLOB_TILDE = 1 shl 12;
  15. GLOB_ONLYDIR = 1 shl 13;
  16. GLOB_TILDE_CHECK = 1 shl 14;
  17. __GLOB_FLAGS = ((((((((((((GLOB_ERR or GLOB_MARK) or GLOB_NOSORT) or GLOB_DOOFFS) or GLOB_NOESCAPE) or GLOB_NOCHECK) or GLOB_APPEND) or GLOB_PERIOD) or GLOB_ALTDIRFUNC) or GLOB_BRACE) or GLOB_NOMAGIC) or GLOB_TILDE) or GLOB_ONLYDIR) or GLOB_TILDE_CHECK;
  18. GLOB_NOSPACE = 1;
  19. GLOB_ABORTED = 2;
  20. GLOB_NOMATCH = 3;
  21. GLOB_NOSYS = 4;
  22. GLOB_ABEND = GLOB_ABORTED;
  23. Type
  24. TGlobCloseDirProc = procedure(Param: Pointer); cdecl;
  25. TGlobReadDirFunc = function(Param: Pointer): PDirEnt; cdecl;
  26. TGlobOpenDirFunc = function(Param: PChar): __ptr_t; cdecl;
  27. TGlobStatFunc = function(Param1: PChar; Param2: PStatBuf): longint; cdecl;
  28. Pglob_t = ^glob_t;
  29. glob_t = record
  30. gl_pathc : size_t;
  31. gl_pathv : ^Pchar;
  32. gl_offs : size_t;
  33. gl_flags : longint;
  34. gl_closedir : TGlobClosedirProc;
  35. gl_readdir : TGlobReaddirFunc;
  36. gl_opendir : TGlobOpendirFunc;
  37. gl_lstat : TGlobStatFunc;
  38. gl_stat : TGlobStatFunc;
  39. end;
  40. TGlobReadDir64Func = function(Param: Pointer): PDirEnt64; cdecl;
  41. TGlobStat64Func = function(Param1: PChar; Param2: PStatBuf64): longint; cdecl;
  42. Pglob64_t = ^glob64_t;
  43. glob64_t = record
  44. gl_pathc: size_t;
  45. gl_pathv: PPChar;
  46. gl_offs: size_t;
  47. gl_flags: longint;
  48. gl_closedir: TGlobCloseDirProc;
  49. gl_readdir: TGlobReaddir64Func;
  50. gl_opendir: TGlobOpenDirFunc;
  51. gl_lstat: TGlobStat64Func;
  52. gl_stat: TGlobStat64Func;
  53. end;
  54. TGlobErrFunc = function(PathName: PChar; ErrNo: longint): longint; cdecl;
  55. function glob(__pattern:Pchar; __flags:longint; __errfunc:TGlobErrFunc; __pglob:Pglob_t):longint;cdecl;external clib name 'glob';
  56. procedure globfree(__pglob:Pglob_t);cdecl;external clib name 'globfree';
  57. function glob64(__pattern: PChar; __flags: longint; __errfunc: TGlobErrFunc; __pglob: Pglob64_t): longint; cdecl;external clib name 'glob64';
  58. procedure globfree64(__pglob: Pglob64_t); cdecl;external clib name 'globfree64';
  59. function glob_pattern_p(__pattern: PChar; __quote: longint): longint; cdecl;external clib name 'glob_pattern_p';
  60. { ---------------------------------------------------------------------
  61. Borland compatibility types
  62. ---------------------------------------------------------------------}
  63. Type
  64. TGlobData = glob_t;
  65. PGlobData = ^TGlobData;
  66. TGlob64Data = glob_t;
  67. PGlob64Data = ^TGlob64Data;
  68. TGlobReadDirProc = TGlobReadDirFunc;
  69. TGlobOpenDirProc = TGlobOpenDirFunc;
  70. TGlobStatProc = TGlobStatFunc;
  71. TGlobReadDir64Proc = TGlobReadDir64Func;
  72. TGlobStat64Proc = TGlobStat64Func;