/*
** SellaNMS
** $Id: dummy.cxx,v 1.9 2005/03/31 18:57:12 sella Exp $
** Copyright (c) 2001-2005 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

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

#include "dummy.h"
#include "debug.h"
#include "storage/storage.h"
#include "storagedata.h"

Dummy::Dummy() {
	this->name.append(" dummy");

	has_scheduler = true;
	has_execute = true;
}

Dummy::~Dummy() {
}

RESULT Dummy::readConfig() {
	RESULT result = SUCCESS;

	block = config->isNode("block");
	config->assignValue("timeout", timeout, MODULE_DUMMY_TIMEOUT_DEFAULT);

	return result;
}

RESULT Dummy::execute() {
	RESULT result = SUCCESS;
	time_t now;

	do {
		usleep (timeout);
		now = time(NULL);
	} while (block);

	return result;
}

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