/* gs-tree.h */

#ifndef _h_tree
#define _h_tree

#include "gs-struct.h"
#include "getstats.h"			/* for sortType */

void AddTreeEntry(	logr *r,	vhost *vh);
void AddRedirEntry(	logr *r,	vhost *vh);
void AddErrorEntry(	logr *r,	vhost *vh);
void ParseReferer(	char *ref,	char *pro,
			char *hos,	char *path);
void PrintVHostSummary(	FILE *rpt,	vhost *thisvhost, int maxlevel);
void PrintCuTotals(	FILE *rpt,	float hours,	int hoursi);
void tablerow2(		FILE *fil,	char *col1, char *col2);
void tablerow2b(	FILE *fil,	char *col1, char *col2, char *perc);
void tablerow3(		FILE *fil,	char *color,
					char *col1, char *col2, char *col3);
void tablerow4(		FILE *fil,	char *col1, char *col2, char *col3,
			char *col4);
void icount2(		FILE *fil,	int tot, char *nam, int val1);
void icount3(		FILE *fil,	char *color,	char *cod,
			char *nam,	int val1);
void isequence(		FILE *fil,	char *nam,
			int val1,	int hoursi);
void fsequence(		FILE *fil,	char *nam,
			float val1,	float hours,	int hoursi);
void PrintTopTen(	FILE *rpt,	vhost *thisvhost);
void PrintTreeHeader(	FILE *rpt,	int maxlevel);
void PrintTreeLevel(	FILE *rpt,	treebranch *br,	int level,
					int maxlevel);
void PrintRedirHeader(	FILE *rpt,	int maxlevel);
void PrintRedirLevel(	FILE *rpt,	treebranch *br,	int level,
					int maxlevel);
int  PrintErrorLevel(	FILE *rpt,	treebranch *br,	char *thisdir,
					int level,	int maxlevel);
void TopTenDTR(		vhost *thisvhost,treebranch *br);
void ResetTreeLevel(	treebranch *br);
int  CompareTreeNodes(	treebranch *node1, treebranch *node2, sortType skey);
void PrintTreeRec( FILE *rpt,	treebranch *br,		int level);
void PrintRedirRec(FILE *rpt,	treebranch *br,		int level);
int  PrintErrorRec(FILE *rpt,	char *thisdir,	treebranch *br, int level);
void PrintFilnam(  FILE *rpt,	char *request);
treebranch *NewBranch(	char *request,	char *url);
ernode     *NewError(	char *request);
treebranch *AddTreeReq(	treebranch *br,	char *request, char *fullreq,
			logr *r,	int *new_node, int count_it);

#endif
