/**********************************************************************
 
	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	<fcntl.h>
#include	"utils.h"
#include	"xl.h"

int
new_file_interpreter(XL_INTERPRETER * xli,L_CHAR * filename)
{
	xli->msg = ll_copy_str(filename);
	xli->inp = s_open_file(n_string(std_cm,filename),O_RDONLY);
	if ( xli->inp == 0 ) {
		xli->mode = XIM_ERROR;
		return -1;
	}
	xli->thread_mode = TM_1;
	setup_xl_interpreter(xli);
	return 0;
}
