Changeset 975 for trunk/client/src/dircache.h
- Timestamp:
- Aug 26, 2016, 6:57:36 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/src/dircache.h
r969 r975 13 13 #include <ndextpl2.h> 14 14 15 // 16 // enable if not defined in your plugin 17 // 18 // dircache code uses only the fname field to scan the directory listing. 19 // other fields are just passed to FNADD callback as are. 20 // 21 #if 0 22 typedef struct smbwrp_fileinfo 15 16 /* callback for fsphAddFile32L */ 17 typedef void FNADDDIRENTRY(void *plist, void *finfo); 18 typedef FNADDDIRENTRY *PFNADDDIRENTRY; 19 20 /* callback for releasing memory */ 21 typedef void FNFREEDIRENTRY(void *finfo); 22 typedef FNFREEDIRENTRY *PFNFREEDIRENTRY; 23 24 25 /* 26 * An entry holds file name and a pointer to custom data 27 */ 28 typedef struct DirectoryCacheEntryData 23 29 { 24 unsigned long long size; 25 unsigned long mtime; 26 unsigned type; 27 char fname[PATH_MAX]; 28 } smbwrp_fileinfo; 29 #else 30 31 // define as forward reference here 32 typedef struct smbwrp_fileinfo smbwrp_fileinfo; 33 34 #endif 30 const char fname[PATH_MAX]; 31 const void* customData; 32 } DirectoryCacheEntryData; 35 33 36 34 /* … … 42 40 struct DirectoryCacheEntry *pPrev; 43 41 44 smbwrp_fileinfo*aInfos;42 DirectoryCacheEntryData *aInfos; 45 43 int cInfos; 46 44 int cInfosAllocated; … … 64 62 // resource handle, used only for per-share logging 65 63 void* resource; 64 // callback called to release data structures 65 PFNFREEDIRENTRY release; 66 66 67 } DirectoryCache; 67 68 … … 73 74 74 75 /* Directory cache helpers. */ 75 int dircache_create(DirectoryCache **ppdc, void* pRes, int cachetimeout, int cachedepth); 76 int dircache_create(DirectoryCache **ppdc, void* pRes, int cachetimeout, int cachedepth, 77 PFNFREEDIRENTRY fn); 76 78 void dircache_delete(DirectoryCache *pdc); 77 78 /* callback for fsphAddFile32L */79 typedef void FNADDDIRENTRY(const char *mnt, smbwrp_fileinfo *finfo,80 const char *mask, void *state);81 typedef FNADDDIRENTRY *PFNADDDIRENTRY;82 79 83 80 /* directory cache scanning */ … … 88 85 int dircache_find_path(DirectoryCache *pdc, 89 86 const char *path, 90 smbwrp_fileinfo*finfo,87 void **finfo, 91 88 unsigned long *pulAge); 92 89 … … 96 93 int cFiles); 97 94 void dircache_write_entry(DirectoryCache *pdc, void *dircachectx, 98 const smbwrp_fileinfo*finfo);95 const char *fname, const void *finfo); 99 96 void dircache_write_end(DirectoryCache *pdc, void *dircachectx); 100 97
Note:
See TracChangeset
for help on using the changeset viewer.