Line | |
---|
1 | #ifndef MTOOLS_DIRCACHE_H
|
---|
2 | #define MTOOLS_DIRCACHE_H
|
---|
3 |
|
---|
4 | typedef enum {
|
---|
5 | DCET_FREE,
|
---|
6 | DCET_USED,
|
---|
7 | DCET_END
|
---|
8 | } dirCacheEntryType_t;
|
---|
9 |
|
---|
10 | #define DC_BITMAP_SIZE 128
|
---|
11 |
|
---|
12 | typedef struct dirCacheEntry_t {
|
---|
13 | dirCacheEntryType_t type;
|
---|
14 | int beginSlot;
|
---|
15 | int endSlot;
|
---|
16 | char *shortName;
|
---|
17 | char *longName;
|
---|
18 | struct directory dir;
|
---|
19 | } dirCacheEntry_t;
|
---|
20 |
|
---|
21 | typedef struct dirCache_t {
|
---|
22 | struct dirCacheEntry_t **entries;
|
---|
23 | int nr_entries;
|
---|
24 | unsigned int nrHashed;
|
---|
25 | unsigned int bm0[DC_BITMAP_SIZE];
|
---|
26 | unsigned int bm1[DC_BITMAP_SIZE];
|
---|
27 | unsigned int bm2[DC_BITMAP_SIZE];
|
---|
28 | } dirCache_t;
|
---|
29 |
|
---|
30 | int isHashed(dirCache_t *cache, char *name);
|
---|
31 | int growDirCache(dirCache_t *cache, int slot);
|
---|
32 | dirCache_t *allocDirCache(Stream_t *Stream, int slot);
|
---|
33 | dirCacheEntry_t *addUsedEntry(dirCache_t *Stream, int begin, int end,
|
---|
34 | char *longName, char *shortName,
|
---|
35 | struct directory *dir);
|
---|
36 | void freeDirCache(Stream_t *Stream);
|
---|
37 | dirCacheEntry_t *addFreeEntry(dirCache_t *Stream, int begin, int end);
|
---|
38 | dirCacheEntry_t *addEndEntry(dirCache_t *Stream, int pos);
|
---|
39 | dirCacheEntry_t *lookupInDircache(dirCache_t *Stream, int pos);
|
---|
40 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.