#include <oxstd.h>
#import <database>

main()
{
	decl args = arglist(), file, db, sout;

	if (sizeof(args) <= 1)
	{	println("Usage: oxl dht2dat oldfile [newfile]");
		exit(0);
	}
	db = new Database();
	db.LoadDht(args[1], 1, 1, 1);
	db.Info();
	sout = sizeof(args) > 2 ? args[2] : args[1];
	
	file = fopen(sout, "wbf");
	fwrite(file, db.GetAllNames());
	fwrite(file, db.GetAll());
	fclose(file);

	println(args[1], " converted to v96, result in:", sout);
}
