/**********************************************************************
 
	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_string(L_CHAR * name)
{
XL_STRING * s;
	s = &get_sexp(0,XLT_STRING)->string;
	if ( name == 0 ) {
		s->data = mmalloc(sizeof(L_CHAR),gc_text);
		s->data[0] = 0;
	}
	else {
		s->data = mmalloc((l_strlen(name)+1)*sizeof(L_CHAR),gc_text);
		l_strcpy(s->data,name);
	}
	return (XL_SEXP*)s;
}

XL_SEXP*
n_get_string(char * name)
{
	return get_string(l_string(std_cm,name));
}
