/**********************************************************************
 
	Copyright (C) 2004 Tomohito Nakajima <nakajima@zeta.co.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 "svg2gb.h"


XL_SEXP * xl_foreignObject();

void
init_foreignObject(XLISP_ENV * env)
{
	set_env(
			env,
			l_string(std_cm,"foreignObject"),
			get_func_prim(xl_foreignObject, FO_NORMAL, gblisp_top_env0, 0, -1)
			);
}


XL_SEXP *
xl_foreignObject(XLISP_ENV * env,XL_SEXP * s,
	XLISP_ENV * a,XL_SYM_FIELD * _sf)
{
XL_SEXP *ss;
XL_SEXP *ret;
	
	for(s=cdr(s); get_type(s)==XLT_PAIR; s = cdr(s)){
		ss = car(s);
/*		print_sexp(s_stdout, ss, PF_XML);*/
		ret = eval(env, ss);
		if ( get_type(ret) == XLT_ERROR ) {
			break;
		}
	}
	return ret;
}
