home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / d / desklib / !DeskLib / h / Filing < prev    next >
Text File  |  1997-01-22  |  4KB  |  118 lines

  1.  
  2. #ifndef __Desk_Filing_h
  3. #define __Desk_Filing_h
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #ifndef __Desk_Core_h
  8. #include "Desk.Core.h"
  9. #endif
  10. #ifndef Desk_filing_MAXLEAFNAMELEN
  11. #define Desk_filing_MAXLEAFNAMELEN 32
  12. #endif
  13. typedef enum {
  14. Desk_filing_NOTFOUND = 0,
  15. Desk_filing_FILE = 1,
  16. Desk_filing_DIRECTORY = 2,
  17. Desk_filing_IMAGEFILE = 3
  18. } Desk_filing_objtype;
  19. typedef struct {
  20. int loadaddr;
  21. int execaddr;
  22. int length;
  23. int attrib;
  24. Desk_filing_objtype objtype;
  25. char name[ Desk_filing_MAXLEAFNAMELEN];
  26. } Desk_filing_direntry;
  27. typedef struct {
  28. int loadaddr;
  29. int execaddr;
  30. int length;
  31. int attrib;
  32. Desk_filing_objtype objtype;
  33. int SIN;
  34. char date[ 5];
  35. char name[ Desk_filing_MAXLEAFNAMELEN];
  36. } Desk_filing_fulldirentry;
  37. typedef enum {
  38. Desk_readdirtype_DIRENTRY,
  39. Desk_readdirtype_FULLDIRENTRY,
  40. Desk_readdirtype_NAMEONLY
  41. } Desk_filing_readdirtype;
  42. typedef struct {
  43. char *dirname;
  44. void *buf;
  45. int size;
  46. Desk_filing_readdirtype type;
  47. union {
  48. Desk_filing_direntry *direntry;
  49. Desk_filing_fulldirentry *fulldirentry;
  50. char *name;
  51. void *act;
  52. } act;
  53. int offset;
  54. int read;
  55. char *match;
  56. } Desk_filing_dirdata;
  57. void Desk_Filing_OpenDir(const char *dirname, Desk_filing_dirdata *dirdata,
  58. int bufsize, Desk_filing_readdirtype type);
  59. void Desk_Filing_OpenDir2(const char *dirname, Desk_filing_dirdata *dirdata,
  60. int bufsize, Desk_filing_readdirtype type, const char* wildcard);
  61. void *Desk_Filing_ReadDir(Desk_filing_dirdata *dirdata);
  62. void Desk_Filing_CloseDir(Desk_filing_dirdata *dirdata);
  63. void Desk_Filing_ReadDirNames(const char *dirname, char *buf,
  64. int *number, int *offset,
  65. int size, const char *match);
  66. void Desk_Filing_ReadDirEntry(const char *dirname, Desk_filing_direntry *buf,
  67. int *number, int *offset,
  68. int size, const char *match);
  69. void Desk_Filing_ReadFullDirEntry(const char *dirname, Desk_filing_fulldirentry *buf,
  70. int *number, int *offset,
  71. int size, const char *match);
  72. void Desk_Filing_ReadCatalogue(const char *filename, Desk_filing_objtype *objtype,
  73. int *loadaddr, int *execaddr, int *length,
  74. int *attrib, int *filetype);
  75. void Desk_Filing_SingleDirEntry(const char *filename,
  76. Desk_filing_direntry *buf, int size);
  77. void Desk_Filing_SingleDirEntry2(const char *dirname,
  78. Desk_filing_direntry *buf,
  79. int size, const char *filename);
  80. void Desk_Filing_SingleFullDirEntry(const char *filename,
  81. Desk_filing_fulldirentry *buf, int size);
  82. void Desk_Filing_SingleFullDirEntry2(const char *dirname,
  83. Desk_filing_fulldirentry *buf,
  84. int size, const char *filename);
  85. char *Desk_Filing_GetPathname(const char *filename, char *pathname);
  86. char *Desk_Filing_GetLeafname(const char *filename, char *leafname);
  87. char *Desk_Filing_FindLeafname(const char *filename);
  88. char *Desk_Filing_MakePath(char *newpath, const char *dirname, const char *leafname);
  89. void Desk_Filing_CanonicalisePath(const char *pathname, char *buffer,
  90. int size, int *spare);
  91. typedef Desk_os_error *(*Desk_filing_scan_startdirfn) (const char *dirname,
  92. Desk_filing_fulldirentry *dirdata,
  93. void *reference);
  94. typedef Desk_os_error *(*Desk_filing_scan_foundfilefn) (const char *dirname,
  95. Desk_filing_fulldirentry *filedata,
  96. void *reference);
  97. typedef Desk_os_error *(*Desk_filing_scan_enddirfn) (const char *dirname,
  98. Desk_filing_fulldirentry *dirdata, 
  99. void *reference);
  100. #define Desk_filing_scan_PRUNE ((Desk_os_error *) 1)
  101. void Desk_Filing_ScanDir(const char *dirname,
  102. Desk_filing_scan_startdirfn startdirproc,
  103. Desk_filing_scan_foundfilefn foundfileproc,
  104. Desk_filing_scan_enddirfn enddirproc,
  105. void *reference
  106. );
  107. void Desk_Filing_ScanDirByDir(const char *dirname,
  108. Desk_filing_scan_startdirfn startdirproc,
  109. Desk_filing_scan_foundfilefn foundfileproc,
  110. Desk_filing_scan_enddirfn enddirproc,
  111. void *reference
  112. );
  113. int Desk_Filing_CompareDates(char date1[5], char date2[5]);
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117. #endif
  118.