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

XL_SEXP*
get_integer(int num,L_CHAR * unit)
{
XL_INTEGER * s;
	s = &get_sexp(0,XLT_INTEGER)->integer;
	s->data = num;
	if ( unit ) {
		s->unit = mmalloc((l_strlen(unit)+1)*sizeof(L_CHAR),gc_text);
		l_strcpy(s->unit,unit);
	}
	else	s->unit = 0;
	return (XL_SEXP*)s;
}

XL_SEXP*
n_get_integer(int num,char * unit)
{
	return get_integer(num,l_string(std_cm,unit));
}
