Changeset 977


Ignore:
Timestamp:
Sep 1, 2016, 5:12:21 PM (9 years ago)
Author:
Yuri Dario
Message:

Hide private data structures in cache code header. ticket#274.

Location:
trunk/client/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/src/dircache.c

    r975 r977  
    1414
    1515extern PLUGINHELPERTABLE2L *ph;
     16
     17/*
     18 * An entry holds file name and a pointer to custom data
     19 */
     20typedef struct DirectoryCacheEntryData
     21{
     22    const char  fname[PATH_MAX];
     23    const void* customData;
     24} DirectoryCacheEntryData;
     25
     26/*
     27 * An entry in the directory cache contains one directory listing.
     28 */
     29typedef struct DirectoryCacheEntry
     30{
     31    struct DirectoryCacheEntry *pNext;
     32    struct DirectoryCacheEntry *pPrev;
     33
     34    DirectoryCacheEntryData *aInfos;
     35    int cInfos;
     36    int cInfosAllocated;
     37
     38    char *pszPath;
     39    ULONG ulHash;
     40    ULONG ulLastUpdateTime;
     41    int fInvalid;
     42} DirectoryCacheEntry;
     43
     44typedef struct DirectoryCache
     45{
     46    NDMUTEX mutex;
     47
     48    DirectoryCacheEntry *pEntriesHead;
     49    DirectoryCacheEntry *pEntriesTail;
     50    int cEntries;
     51    int fEnabled;
     52    unsigned long ulExpirationTime;
     53    int cMaxEntries;
     54    // resource handle, used only for per-share logging
     55    void* resource;
     56    // callback called to release data structures
     57    PFNFREEDIRENTRY release;
     58
     59} DirectoryCache;
     60
     61enum {
     62    CacheFault = 0,
     63    CacheOk = 1
     64};
    1665
    1766/*
  • trunk/client/src/dircache.h

    r975 r977  
    2222typedef FNFREEDIRENTRY *PFNFREEDIRENTRY;
    2323
    24 
    25 /*
    26  * An entry holds file name and a pointer to custom data
    27  */
    28 typedef struct DirectoryCacheEntryData
    29 {
    30     const char  fname[PATH_MAX];
    31     const void* customData;
    32 } DirectoryCacheEntryData;
    33 
    34 /*
    35  * An entry in the directory cache contains one directory listing.
    36  */
    37 typedef struct DirectoryCacheEntry
    38 {
    39     struct DirectoryCacheEntry *pNext;
    40     struct DirectoryCacheEntry *pPrev;
    41 
    42     DirectoryCacheEntryData *aInfos;
    43     int cInfos;
    44     int cInfosAllocated;
    45 
    46     char *pszPath;
    47     ULONG ulHash;
    48     ULONG ulLastUpdateTime;
    49     int fInvalid;
    50 } DirectoryCacheEntry;
    51 
    52 typedef struct DirectoryCache
    53 {
    54     NDMUTEX mutex;
    55 
    56     DirectoryCacheEntry *pEntriesHead;
    57     DirectoryCacheEntry *pEntriesTail;
    58     int cEntries;
    59     int fEnabled;
    60     unsigned long ulExpirationTime;
    61     int cMaxEntries;
    62     // resource handle, used only for per-share logging
    63     void* resource;
    64     // callback called to release data structures
    65     PFNFREEDIRENTRY release;
    66 
    67 } DirectoryCache;
    68 
    69 enum {
    70     CacheFault = 0,
    71     CacheOk = 1
    72 };
    73 
     24/* forward declarations */
     25typedef struct DirectoryCache DirectoryCache;
    7426
    7527/* Directory cache helpers. */
Note: See TracChangeset for help on using the changeset viewer.