//////////////////////////////////////////////////////////////////
// Graphing of multiscale fixed size long term rotating log file
// Author: Marijn Weehuizen (based on mrtg code)
//
// Note: Requires the use of gd graphics library 
//       (which in turn requires libpng and zlib)
//////////////////////////////////////////////////////////////////


// Reqd to draw pretty graphs
typedef struct _MLOG_IMAGE {	// Graph description passed in 
	long xpix, ypix;	// Size of the graph in x/y coordinates

	int peak;			// Display peak information
	short options;		// Special options

	double xscale, yscale;

	int nodata;
	char* pngtitle;
	char* ylabel;
	long maxy,miny;
} MLOG_IMAGE;


//int mlog_graph(char *file, MLOG_IMAGE *pimage, MLOG *data, int scale, time_t graphtime );
int mlog_graph(char *file, MLOG_IMAGE *pimage, MLOG *log, int scale, time_t now, int logbase, int timebase);
int mlog_graph2(char *file, MLOG_IMAGE *pimage, MLOG *log, int scale, time_t now, int logbase, int timebase, double yfactor, int cutoff);

extern int col_in[3], col_out[3], col_inm[3], col_outm[3], col_outp[3];


#define OPTION_WITHZEROES	0x0001	/* withzeros */
#define OPTION_UNKNASZERO	0x0002	/* unknaszero */
#define OPTION_TRANSPARENT	0x0004	/* transparent */
#define OPTION_DORELPERCENT	0x0008	/* dorelpercent */
#define OPTION_NOBORDER		0x0010	/* noborder */
#define OPTION_NOARROW		0x0020	/* noarrow */
#define OPTION_I			0x0040	/* ignore 'I' (first) variable */
#define OPTION_O			0x0080	/* ignore 'O' (second) variable */
#define OPTION_PNGDATE		0x0100	/* show date & time in graph */
#define OPTION_GROWRIGHT	0x0200	/* have new values addedon right */


typedef struct _timebase {char* name; int time; } TIMEBASE;
extern TIMEBASE xtimebase[];
