lpmoo-1.2/etc/
lpmoo-1.2/mudlib/
lpmoo-1.2/mudlib/etc/
lpmoo-1.2/mudlib/include/
lpmoo-1.2/mudlib/include/moo/
lpmoo-1.2/mudlib/lpc/
lpmoo-1.2/mudlib/std/auto/
lpmoo-1.2/mudlib/std/bfuns/
/*
 * NAME:	dbsaver.c
 * DESCRIPTION:	routines for saving a MOO db file
 */

# define DEBUG  0

inherit "/std/core";
inherit "/std/string";

# if DEBUG
inherit "/std/vartext";
# else
# define var2str(x)  ""
# endif

# include <objects.h>
# include <moo/data.h>
# include <moo/config.h>
# include <dgd/limits.h>
# include <dgd/status.h>

# define DELAY		2
# define CHUNK		500
# define SIZE		(7 * MAX_STRING_SIZE / 8)
# define MEMUSED()	(status()[ST_DMEMUSED])
# define MEMFREE()	(MEMUSED() < maxmem)

object	driver;		/* the driver object */

int	maxmem;		/* memory threshold to begin swapping */
string	dbfile;		/* name of the db file */

/*
 * NAME:	main()
 * DESCRIPTION:	write the database to a file
 */
void main(string file)
{
  dbfile = file;

  maxmem = CONFIG->query(CF_MEMORY_THRESH);
}