Timothe Litt 886c1fae06 Preliminary merge with Baker + other changes
Many style/formatting edits.

Bug fixes.

Reverted some previous changes temporarily while reviewing new code.

Merged Baker's "virtual device" in a simpler form.  ODS2 will assign a sensible
drive name when mounting /image (== /virtual).  If a specific drive name
is desired, mount /image drivename=filespec.

Files can be quoted, or use set qualifier_style unix if slashes are a problem.
Note that mount on the command line allows tab completion.

Moved "statistics" command into show.

Coded support for import/binary (fixed records, 512 bytes).

Converted fgets to fgetline

Added show devices for Unix (limited by standard APIs)

Got rid of separate ODS2-Image build.
2016-03-05 01:27:56 -05:00

54 lines
2.0 KiB
C

/* Cache.h V2.1 Definitions for cache routines */
/*
This is part of ODS2 written by Paul Nankervis,
email address: Paulnank@au1.ibm.com
ODS2 is distributed freely for all members of the
VMS community to use. However all derived works
must maintain comments in their source to acknowledge
the contibution of the original author.
*/
#ifndef _CACHE_H
#define _CACHE_H
#ifdef VAXC /* Stupid VAX C doesn't allow "signed" keyword */
#define signed
#else
#define signed signed
#endif
struct CACHE {
struct CACHE *nextlru; /* next object on least recently used list */
struct CACHE *lastlru; /* last object on least recently used list */
struct CACHE *left; /* left branch of binary tree */
struct CACHE *right; /* right branch of binary tree */
struct CACHE **parent; /* address of pointer to this object */
void *(*objmanager) (struct CACHE * cacheobj,int flushonly);
unsigned hashval; /* object hash value */
short refcount; /* object reference count */
signed char balance; /* object tree imbalance factor */
signed char objtype; /* object type (for debugging) */
#define OBJTYPE_DEV 1
#define OBJTYPE_FCB 2
#define OBJTYPE_WCB 3
#define OBJTYPE_VIOC 7
};
void cache_show(void);
int cache_refcount(struct CACHE *cacheobj);
struct CACHE *cache_delete(struct CACHE *cacheobj);
void cache_purge(void);
void cache_flush(void);
void cache_remove(struct CACHE *cacheobj);
void cache_touch(struct CACHE * cacheobj);
void cache_untouch(struct CACHE * cacheobj,int recycle);
void *cache_find( void **root, unsigned hashval, void *keyval, unsigned *retsts,
int (*compare_func) ( unsigned hashval, void *keyval,
void *node ),
void *(*create_func) ( unsigned hashval, void *keyval,
unsigned *retsts ) );
#endif /* #ifndef _CACHE_H */