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


int
rect_type(XL_SEXP * s)
{
XL_SEXP * tl,* br;
	if ( list_length(s) != 2 )
		return -1;
	tl = get_el(s,0);
	br = get_el(s,1);
	if ( list_length(tl) != 2 )
		return -1;
	if ( list_length(br) != 2 )
		return -1;
	if ( get_type(get_el(tl,0)) != XLT_INTEGER &&
		get_type(get_el(tl,0)) != XLT_FLOAT )
		return -1;
	if ( get_type(get_el(tl,1)) != XLT_INTEGER &&
		get_type(get_el(tl,1)) != XLT_FLOAT )
		return -1;
	if ( get_type(get_el(br,0)) != XLT_INTEGER &&
		get_type(get_el(br,0)) != XLT_FLOAT )
		return -1;
	if ( get_type(get_el(br,1)) != XLT_INTEGER &&
		get_type(get_el(br,1)) != XLT_FLOAT )
		return -1;
	return 0;
}
