source: trunk/client/src/dircache.h

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

Minor code cleaning.

File size: 1.8 KB
RevLine 
[965]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
[984]9#ifdef __cplusplus
10extern "C" {
11#endif
12
[965]13#include <limits.h>
14
15#define NDPL_LARGEFILES
16#define INCL_LONGLONG
17#include <ndextpl2.h>
18
[969]19
[975]20/* callback for fsphAddFile32L */
21typedef void FNADDDIRENTRY(void *plist, void *finfo);
22typedef FNADDDIRENTRY *PFNADDDIRENTRY;
[969]23
[975]24/* callback for releasing memory */
25typedef void FNFREEDIRENTRY(void *finfo);
26typedef FNFREEDIRENTRY *PFNFREEDIRENTRY;
[965]27
[977]28/* forward declarations */
29typedef struct DirectoryCache DirectoryCache;
[975]30
[965]31/* Directory cache helpers. */
[975]32int dircache_create(DirectoryCache **ppdc, void* pRes, int cachetimeout, int cachedepth,
[983]33 PFNFREEDIRENTRY fn, PLUGINHELPERTABLE2L *ph);
[965]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,
[975]43 void **finfo,
[965]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,
[975]51 const char *fname, const void *finfo);
[965]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
[984]59#ifdef __cplusplus
60}
61#endif
62
[965]63#endif // __DIRCACHE_H__
Note: See TracBrowser for help on using the repository browser.