/**********************************************************************
 
	Copyright (C) 2003 Hirohisa MORI <joshua@nichibun.ac.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/



#include	<stdio.h>
#include	"xl.h"
#include	"task.h"
#include	"pri_level.h"
#include	"gbview.h"
#include	"v.h"

void
wait_stop_all_and_exit()
{
	wait_stop_all();
	printf("connection closed.\n");
	exit(0);
}

int
_main(int argc,char ** argv)
{
int i;


printf("GBVIEW %i\n",get_xltime());

	view_init(argc,argv);

	init_gbview_function(gblisp_top_env0, gblisp_top_env1);
	
	if ( argc < 2 ) {
		printf("too few arguments\n");
		exit(1);
	}

	xl_setup_file_nowait(argc,argv);
	create_task(wait_stop_all_and_exit,0,PRI_XL_FRONT);
	event_loop();

	return 0;
}
