dirCache.h

Go to the documentation of this file.
00001 #ifndef MTOOLS_DIRCACHE_H
00002 #define MTOOLS_DIRCACHE_H
00003 
00004 typedef enum {
00005         DCET_FREE,
00006         DCET_USED,
00007         DCET_END
00008 } dirCacheEntryType_t;
00009 
00010 #define DC_BITMAP_SIZE 128
00011 
00012 typedef struct dirCacheEntry_t {
00013         dirCacheEntryType_t type;
00014         int beginSlot;
00015         int endSlot;
00016         char *shortName;
00017         char *longName;
00018         struct directory dir;
00019 } dirCacheEntry_t;
00020 
00021 typedef struct dirCache_t {
00022         struct dirCacheEntry_t **entries;
00023         int nr_entries;
00024         unsigned int nrHashed;
00025         unsigned int bm0[DC_BITMAP_SIZE];
00026         unsigned int bm1[DC_BITMAP_SIZE];
00027         unsigned int bm2[DC_BITMAP_SIZE];
00028 } dirCache_t;
00029 
00030 int isHashed(dirCache_t *cache, char *name);
00031 int growDirCache(dirCache_t *cache, int slot);
00032 dirCache_t *allocDirCache(Stream_t *Stream, int slot);
00033 dirCacheEntry_t *addUsedEntry(dirCache_t *Stream, int begin, int end, 
00034                               char *longName, char *shortName,
00035                               struct directory *dir);
00036 void freeDirCache(Stream_t *Stream);
00037 dirCacheEntry_t *addFreeEntry(dirCache_t *Stream, int begin, int end);
00038 dirCacheEntry_t *addEndEntry(dirCache_t *Stream, int pos);
00039 dirCacheEntry_t *lookupInDircache(dirCache_t *Stream, int pos);
00040 #endif

Generated on Fri Apr 14 22:56:55 2006 for minix by  doxygen 1.4.6