/**********************************************************************
 
	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	"init.h"
#include	"utils.h"
#include	"change_endian.h"
#include	"stream.h"

#include	<stdio.h>

int stab_status;

int
main(int argc,char ** argv)
{
extern char * command_arg;

	command_arg = argv[0];
	stab_status = stabilizer(&argc, &argv); 

	check_endian();
	init_task(INI_DONTWAITCHI);
	init_tick();
	init_d_alloc();
	init_longchar();
	init_stream();
	init_utils();
	init_netutils();
	init_resolve();

	if (argc>=1 && argv[1][0] == '+' ) {
		if(stab_status == 's'){
			proc_recv_stream(&(argv[1][1]));
		}
		else{
			printf("Can not receive streams.This process is launched by gbpo.exe\n %s", command_arg);
		}
		argv ++;
		argc --;
	}
	
	argv[0] = command_arg;
	return _main(argc,argv);
}
