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

XL_SEXP *
get_func_prim(
	      XL_SEXP *(*func)(),
	      int order,
	      XLISP_ENV * args_env,
	      int min,
	      int max)
{
XL_SEXP * ret;
	ret = get_sexp(0,XLT_FUNC);
	ret->func.type = FT_PRIM;
	ret->func.order = order;
	ret->func.args_env = args_env;
	ret->func.sp_env = 0;
	ret->func.min = min;
	ret->func.max = max;
	ret->func.prim = func;
	return ret;
}


XL_SEXP *
get_func_prim_sp(
		XL_SEXP *(*func)(),
		int order,
		XLISP_ENV * args_env,
		XLISP_ENV * sp_env,
		int min,
		int max)
{
XL_SEXP * ret;
	ret = get_sexp(0,XLT_FUNC);
	ret->func.type = FT_PRIM;
	ret->func.order = order;
	ret->func.args_env = args_env;
	ret->func.sp_env = sp_env;
	ret->func.min = min;
	ret->func.max = max;
	ret->func.prim = func;
	return ret;
}

