/**********************************************************************
 
	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"

#include "HTMLDB.h"

XL_SEXP * xl_LoadHtmlDB();

void
init_LoadHtmlDB(XLISP_ENV * env)
{
	set_env(env,l_string(std_cm,"LoadHtmlDB"),
		get_func_prim(xl_LoadHtmlDB,FO_APPLICATIVE,0,0,256));	
}

XL_SEXP * xl_LoadHtmlDB(XLISP_ENV * env,XL_SEXP * s,XLISP_ENV * arg_env,XL_SYM_FIELD * sf)
{
	XL_SEXP* tmp;
	tmp = load_file(env,s,1,l_string(std_cm,"out.txt"),0,0,0,0,0);
	HTMLDataBase = cons(tmp,HTMLDataBase);
	set_env(env,HTMLDataBase->symbol.data,HTMLDataBase);
	return HTMLDataBase;
	
	//すでにデータベースに要素が登録されているときの動作は未定義
}
