source: trunk/minix/commands/i386/mtools-3.9.7/dirCache.h@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 1.1 KB
Line 
1#ifndef MTOOLS_DIRCACHE_H
2#define MTOOLS_DIRCACHE_H
3
4typedef enum {
5 DCET_FREE,
6 DCET_USED,
7 DCET_END
8} dirCacheEntryType_t;
9
10#define DC_BITMAP_SIZE 128
11
12typedef 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
21typedef 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
30int isHashed(dirCache_t *cache, char *name);
31int growDirCache(dirCache_t *cache, int slot);
32dirCache_t *allocDirCache(Stream_t *Stream, int slot);
33dirCacheEntry_t *addUsedEntry(dirCache_t *Stream, int begin, int end,
34 char *longName, char *shortName,
35 struct directory *dir);
36void freeDirCache(Stream_t *Stream);
37dirCacheEntry_t *addFreeEntry(dirCache_t *Stream, int begin, int end);
38dirCacheEntry_t *addEndEntry(dirCache_t *Stream, int pos);
39dirCacheEntry_t *lookupInDircache(dirCache_t *Stream, int pos);
40#endif
Note: See TracBrowser for help on using the repository browser.