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

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

Minor code cleaning.

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#ifdef __cplusplus
10extern "C" {
11#endif
12
13#include <limits.h>
14
15#define NDPL_LARGEFILES
16#define INCL_LONGLONG
17#include <ndextpl2.h>
18
19
20/* callback for fsphAddFile32L */
21typedef void FNADDDIRENTRY(void *plist, void *finfo);
22typedef FNADDDIRENTRY *PFNADDDIRENTRY;
23
24/* callback for releasing memory */
25typedef void FNFREEDIRENTRY(void *finfo);
26typedef FNFREEDIRENTRY *PFNFREEDIRENTRY;
27
28/* forward declarations */
29typedef struct DirectoryCache DirectoryCache;
30
31/* Directory cache helpers. */
32int dircache_create(DirectoryCache **ppdc, void* pRes, int cachetimeout, int cachedepth,
33 PFNFREEDIRENTRY fn, PLUGINHELPERTABLE2L *ph);
34void dircache_delete(DirectoryCache *pdc);
35
36/* directory cache scanning */
37int dircache_list_files(DirectoryCache *pdc, PFNADDDIRENTRY fn,
38 void *plist,
39 char* dir_mask, char* fullpath,
40 int *ptotal_received);
41int dircache_find_path(DirectoryCache *pdc,
42 const char *path,
43 void **finfo,
44 unsigned long *pulAge);
45
46/* directory cache creation */
47void *dircache_write_begin(DirectoryCache *pdc,
48 char* dir_mask, char* fullpath,
49 int cFiles);
50void dircache_write_entry(DirectoryCache *pdc, void *dircachectx,
51 const char *fname, const void *finfo);
52void dircache_write_end(DirectoryCache *pdc, void *dircachectx);
53
54/* directory cache invalidation */
55void dircache_invalidate(DirectoryCache *pdc,
56 const char *path,
57 int fParent);
58
59#ifdef __cplusplus
60}
61#endif
62
63#endif // __DIRCACHE_H__
Note: See TracBrowser for help on using the repository browser.