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

XL_SEXP * xl_HttpServer();


void
init_HttpServer(XLISP_ENV * env)
{
	set_env(env,l_string(std_cm,"HttpServer"),
		get_func_prim(xl_HttpServer,FO_APPLICATIVE,0,0,256));
}

XL_SEXP *
xl_HttpServer(XLISP_ENV * env,XL_SEXP * s,
	  XLISP_ENV * arg_env,XL_SYM_FIELD * sf)
{
	L_CHAR port[32];
	for ( ; sf ; sf = sf->next ) 
	{
		if ( l_strcmp(sf->name,l_string(std_cm,"port"))== 0 ) 
			l_strcpy(port,sf->data);
	}
	init_http_server();
	
	return s;
}


