home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / ods2 / src / cache.h < prev    next >
C/C++ Source or Header  |  1998-09-11  |  1KB  |  45 lines

  1. /* Cache.h v1.2    Definitions for cache routines */
  2.  
  3. /*
  4.         This is part of ODS2 written by Paul Nankervis,
  5.         email address:  Paulnank@au1.ibm.com
  6.  
  7.         ODS2 is distributed freely for all members of the
  8.         VMS community to use. However all derived works
  9.         must maintain comments in their source to acknowledge
  10.         the contibution of the original author.
  11. */
  12.  
  13. #ifndef CACHE_WRITE
  14.  
  15. #define CACHE_WRITE 1
  16. #define CACHE_MODIFIED 2
  17.  
  18. struct CACHE {
  19.     struct CACHE **parent;
  20.     struct CACHE *left;
  21.     struct CACHE *right;
  22.     struct CACHE *nxtcache;
  23.     struct CACHE *lstcache;
  24.     struct CACHE *(*objmanager) (struct CACHE * cacheobj);
  25.     unsigned keyval;
  26.     unsigned status;
  27.     int refcount;
  28. };
  29.  
  30. void cacheshow(void);
  31. void cachedump(void);
  32. void cacheprint(struct CACHE *cacheobj,int level);
  33. void cacheflush(void);
  34. int cacherefcount(struct CACHE *cacheobj);
  35. void cachedeltree(struct CACHE *cacheobj);
  36. void cachetouch(struct CACHE *cacheobj);
  37. unsigned cacheuntouch(struct CACHE *cacheobj,unsigned reuse,unsigned modflg);
  38. struct CACHE *cachefree(struct CACHE *cacheobj);
  39. struct CACHE *cachedelete(struct CACHE *cacheobj);
  40. struct CACHE *cachemake(struct CACHE **parent,unsigned length);
  41. void *cachesearch(void **root,unsigned keyval,unsigned keylen,void *key,
  42.                   int (*cmpfunc) (unsigned keylen,void *key,void *node),
  43.                   unsigned *createsize);
  44. #endif
  45.