#ifndef OMCCLEANER__H
#define OMCCLEANER__H

#include "../../../../plat/public/src/include/pub_include.h"
#include "../../../omcLib/c_program/omcLib/omcLib.h"
#include "../../../../plat/snmp/src/include/snmp.h"
#include <sys/types.h>
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdio.h>

#ifndef MYSQL_H
	#include "mysql.h"
#endif
	
#ifndef OMCCLEANER_DEBUG
	#define OMCCLEANER_DEBUG 0
#endif

//Define in omc_cleaner.c
int omc_cleaner_init();
void omc_cleaner_timer();
void logMessage(const char *fmt,...);

//Define in omc_task.c
int omc_task_init();
int omc_task_timer();

#define CONF_FILE "./conf/omc_db.conf"
#define MAX_NODE_NUM 64

#define MTN_STATE_IDLE 0
#define MTN_STATE_INIT 1
#define MTN_STATE_PROC 2
#define MTN_STATE_FINISH 3

typedef struct tableMtnNode
{
	char database_name[32];
	char table_name[32];
	char time_fieldname[32];
	unsigned long keep_seconds;
	unsigned long keep_records;
	int valid;	//some table do not exist,or the time field do not exist,then invalid
}tableMtnNode;

typedef struct fileMtnNode
{
	char directory[128];
	char keyword[64];
	unsigned long keep_seconds;
}fileMtnNode;

typedef struct tableMtnNodeList
{
	tableMtnNode node[MAX_NODE_NUM];
	int node_count;
	int cur_index;
	int state;
}tableMtnNodeList;

typedef struct fileMtnNodeList
{
	fileMtnNode node[MAX_NODE_NUM];
	int node_count;
	int cur_index;
	int state;
}fileMtnNodeList;

#endif
