#ifndef MAILUTIL
#define MAILUTIL
#include "xutil.h"
#include "mailnode.h"
#include "confignode.h"
#include "getword.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include <time.h>

class	mailutil {
	public:
					mailutil(xutil *xu,
						confignode *cfgf);
					~mailutil();
			void		CheckMail();
			void		CopyNodes();
			mailnode	*first, *last;
	private:
			mailnode	*current;
			mailnode	*tempfirst, *tempcurrent, *templast;
			xutil		*xutility;
			confignode	*cfgfirst, *cfgcurrent;
			int		checked;
			int		checking;
			int		copying;
			timeb		lasttime, thistime;

		static	void		CheckMailCB(XtPointer XtP, 
							XtIntervalId *XtI);
			void		DeleteTempNodes();
			void		DeleteNodes();
			void		StripName(char **name);
			void		AddEntry(char *name);
};

#endif
