/**********************************************************************
 
	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	<stdlib.h>
#include	"init.h"
#include	"xl.h"

int test_n;

int wait_flag;
SEM ws;


void
test_t()
{
	printf("task %i\n",test_n++);
}

int
submain(int argc,char ** argv)
{

int n;
int tid;

	init_xl(INI_DONTWAITCHI);


	if ( argc < 2 ) {
		fprintf(stderr,"too few argments\n");
		exit(1);
	}
	init_function(gblisp_top_env0,gblisp_top_env1,argc,argv);
	xl_setup_file(argc,argv);

	return 0;
}



int
_main(int argc,char ** argv)
{
	if ( argc >= 2 && argv[1][0] == '-' && argv[1][1] ) {
		if ( strcmp(argv[1],"-lex") == 0 )
			return lexmain(argc,argv);
		else	return parsemain(argc,argv);
	}
	else return submain(argc,argv);
}
