/* This is the setup file for the db layer. */
/* Ripped wholesale from UnterMUD, by mjr */

#ifndef DB_SETUP_H
#define DB_SETUP_H

/* this stuff must be provided by the MUD */
extern int pack_object (Object * o, FILE * f);
extern Object *unpack_object (FILE * f);
#define objid_hash(OID, CWIDTH)     ((OID) % (CWIDTH))

/* this stuff is provided by the db routines */
/* cache access/update functions (from 'cache.c') */

extern int cache_init (void);
extern int cache_sync (void);
extern int cache_put (Object * obj, int oid);
extern int cache_check (int oid);
extern void cache_reset (void);

/* DBM-based db routines (from 'DB/dbmchunk.c') */

extern int dddb_check (int oid);
extern int dddb_close (void);
extern int dddb_del (int oid, int flg);
extern Object *dddb_get (int oid);
extern int dddb_init (int db_must_exist);
extern int dddb_initted (void);
extern int dddb_put (Object * obj, int oid);
extern int dddb_setfile (const char *fil);

#endif /* !DB_SETUP_H */