/**********************************************************************
 
 	Copyright (C) 2004
		Hirohisa MORI <joshua@nichibun.ac.jp>
		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	"stream.h"
#include	"long_char.h"
#include	"xlerror.h"
#include	"xl.h"
#include	"utils.h"
#include	"memory_debug.h"
#include	"machine/include.h"

XL_SEXP * xl_GetCwd();

void
init_GetCwd(XLISP_ENV * env)
{
	set_env(env,l_string(std_cm,"GetCwd"),
		get_func_prim(xl_GetCwd, FO_NORMAL, 0, 1, 1));
}

XL_SEXP *
xl_GetCwd(XLISP_ENV * env,XL_SEXP * s)
{
char buff[512];
char *name;
XL_SEXP *ret;
	m_getcwd(buff, sizeof(buff));
	name = change_delim_str(buff);
	ret = get_string(l_string(std_cm,name));
	d_f_ree(name);
	return ret;
}


