source: trunk/client/src/dircache.h@ 983

Last change on this file since 983 was 983, checked in by Yuri Dario, 9 years ago

Get plugin helper table pointer at init time. ticket#274.

File size: 1.8 KB
Line 
1/*
2 Directory caching code for Netdrive plugins.
3 Copyright (C) netlabs.org 2010-2016
4*/
5
6#ifndef __DIRCACHE_H__
7#define __DIRCACHE_H__
8
9#include <limits.h>
10
11#define NDPL_LARGEFILES
12#define INCL_LONGLONG
13#include <ndextpl2.h>
14
15
16/* callback for fsphAddFile32L */
17typedef void FNADDDIRENTRY(void *plist, void *finfo);
18typedef FNADDDIRENTRY *PFNADDDIRENTRY;
19
20/* callback for releasing memory */
21typedef void FNFREEDIRENTRY(void *finfo);
22typedef FNFREEDIRENTRY *PFNFREEDIRENTRY;
23
24/* forward declarations */
25typedef struct DirectoryCache DirectoryCache;
26
27/* Directory cache helpers. */
28int dircache_create(DirectoryCache **ppdc, void* pRes, int cachetimeout, int cachedepth,
29 PFNFREEDIRENTRY fn, PLUGINHELPERTABLE2L *ph);
30void dircache_delete(DirectoryCache *pdc);
31
32/* directory cache scanning */
33int dircache_list_files(DirectoryCache *pdc, PFNADDDIRENTRY fn,
34 void *plist,
35 char* dir_mask, char* fullpath,
36 int *ptotal_received);
37int dircache_find_path(DirectoryCache *pdc,
38 const char *path,
39 void **finfo,
40 unsigned long *pulAge);
41
42/* directory cache creation */
43void *dircache_write_begin(DirectoryCache *pdc,
44 char* dir_mask, char* fullpath,
45 int cFiles);
46void dircache_write_entry(DirectoryCache *pdc, void *dircachectx,
47 const char *fname, const void *finfo);
48void dircache_write_end(DirectoryCache *pdc, void *dircachectx);
49
50/* directory cache invalidation */
51void dircache_invalidate(DirectoryCache *pdc,
52 const char *path,
53 int fParent);
54
55#endif // __DIRCACHE_H__
Note: See TracBrowser for help on using the repository browser.