/*
** SellaNMS
** $Id: tidy.h,v 1.3 2005/11/14 08:21:01 sella Exp $
** Copyright (c) 2001-2005 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

#ifndef __DGS_INTERNAL_TIDY_H
#define __DGS_INTERNAL_TIDY_H

#ifdef HAVE_CONFIG_H
	#include "config.h"
#endif

#include "defaults.h"
#include "common/util.h"
#include "storage/storage.h"
#include <stdio.h>
#include <stdlib.h>

#define INTERNAL_TIDY_INTERVAL_DEF		45		//45 sec
#define INTERNAL_TIDY_INTERVAL_MIN		1		//1 sec
#define INTERNAL_TIDY_INTERVAL_MAX		21600	//6 hours
#define INTERNAL_TIDY_OUTPUTAGE_DEF		300	//5 min
#define INTERNAL_TIDY_OUTPUTAGE_MIN		60		//60 sec
#define INTERNAL_TIDY_OUTPUTAGE_MAX		21600	//6 hours

class Tidy {
	public:
		Tidy();
		virtual ~Tidy();
		virtual RESULT execute();
		virtual RESULT readConfig();

	protected:
		virtual void printConfig();
		RESULT cleanOutput();

	private:
		Storage storage;

		unsigned long interval;
		unsigned long outputAge;
};

#endif

/*
** Local Variables:
** c-basic-offset: 3
** tab-width: 3
** End:
** vim600: fdm=marker
** vim: noet ts=3 sw=3
*/
