/* $Id: main.c,v 1.1 1997/06/10 16:19:21 archer Exp $
 *	MAIN.C - Entry point of the Lorenai mapping tool
 */
#include "lorenai.h"
#include <Widget/Widgets.h>
#include <ctype.h>
#include <memory.h>
#include <string.h>


/**
 ** Prototypes from other files
 **/
extern void read_box(char *);
extern void make_ui(void);


/**
 ** USAGE
 **	Bad arguments used
 **/
static void usage(void)
{
	fprintf(stderr, "Usage: loretool [x11-args] [reports...]\n");
	exit(1);
}


/**
 ** MAIN
 **	Entry point
 **/
int main(int argc, char **argv)
{
char	*arg;
/*
 * X11 Argument parsing
 */
	X11_Initialize("Loretool", "Loretool.ad", &argc, argv);
/*
 * Initialisations
 */
	pre_load();
/*
 * Tool arguments
 */
	argc--;
	argv++;
	while (argc--) {
		arg = *argv++;
		if (*arg == '-')
			usage();
		read_box(arg);
	}
/*
 * Start up the user interface
 */
	make_ui();
	X11_MainLoop();
/*
 * Never goes here
 */
	return 0;
}
