/*
	Header file for the UnterMud DB layer, as applied to MUSH 2.0

	Andrew Molitor, amolitor@eagle.wesleyan.edu
	1991
*/


typedef struct Attr {
	int	size;
	char	*data;
} Attr;

/*
some machines stdio use different parameters to tell fopen to open
a file for creation and binary read/write. that is why they call it
the "standard" I/O library, I guess. for HP/UX, you need to have
this "rb+", and make sure the file already exists before use. bleah
*/
#define	FOPEN_BINARY_RW	"a+"


#ifdef VMS
#define MAXPATHLEN	256
#define	NOSYSTYPES_H
#define	NOSYSFILE_H
#endif VMS

/*
Maximum key size. MUSH has a define somewhere for this, possibly even MAXKEY.
Use that instead of this. grep around and replace all refs to MAXKEY with
whatever it is MUSH uses.
*/

#define	MAXKEY	17

/* If your malloc() returns void or char pointers... */
/* typedef	void	*mall_t; */
typedef	char	*mall_t;

/* default (runtime-resettable) cache parameters */
#define	CACHE_DEPTH	20
#define	CACHE_WIDTH	512

/* Macros for calling the DB layer */

#define	DB_INIT()	dddb_init()
#define	DB_CLOSE()	dddb_close()
#define	DB_SYNC()	dddb_sync()
#define	DB_GET(n)	dddb_get(n)
#define	DB_PUT(o,n)	dddb_put(o,n)
#define	DB_CHECK(s)	dddb_check(s)
#define	DB_DEL(n,f)	dddb_del(n,f)
#define	DB_BACKUP(f)	dddb_backup(f)
#define	DB_TRAVSTART()	dddb_travstart()
#define	DB_TRAVERSE(b)	dddb_traverse(b)
#define	DB_TRAVEND()	dddb_travend()
#define	CMD__DBCONFIG	cmd__dddbconfig

extern Attr *cache_get();
extern int cache_put();
extern int cache_check();
extern int cache_init();
extern void cache_reset();
extern int cache_sync();
extern int cache_del();
extern Attr *attrfromFILE();