/**********************************************************************
 
	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	<InternetConfig.h>
#include	"memory_debug.h"
#include	"utils.h"

extern int max_fid;
char *http_client = 0;

void
http_system(
	char * hostname,
	int port,
	char * page)
{
char buf[1000];
ICInstance *inst;
long start = 0, end;
	ICStart(&inst, 'GBVI');

	if ( page == 0 ) {
		sprintf(buf,"http://%s:%i/", hostname, port);
	} else {
		sprintf(buf,"%s",page);
	}
	printf("--> %s\n", buf);
	end = strlen(buf);
	ICLaunchURL(inst, "\p", buf, end, &start, &end);

	ICStop(inst);
}
