+Thu Dec 7 20:33:23 WST 2006 John Darrington <john@darrington.wattle.id.au>
+
+ * getl.c getl.h : Changed signature of create function to take a
+ string indicating the initial include path.
+
Sun Dec 3 11:36:10 2006 Ben Pfaff <blp@gnu.org>
* str.h (SS_LITERAL_INITIALIZER): Cast the string literal to "char
02110-1301, USA. */
#include <stdlib.h>
-
#include <config.h>
#include "getl.h"
#include <libpspp/version.h>
#include <libpspp/alloc.h>
-#include <data/file-name.h>
-
struct getl_source
{
struct getl_source *included_from; /* File that this is nested inside. */
/* Initialize getl. */
struct source_stream *
-create_source_stream (void)
+create_source_stream (const char *initial_include_path)
{
struct source_stream *ss = xzalloc (sizeof (*ss));
ll_init (&ss->sources);
+#if 0
ds_init_cstr (&ss->the_include_path,
fn_getenv_default ("STAT_INCLUDE_PATH", include_path));
+#endif
+ ds_init_cstr (&ss->the_include_path, initial_include_path);
+
return ss;
}
struct source_stream;
-struct source_stream * create_source_stream (void);
+struct source_stream * create_source_stream (const char *);
void destroy_source_stream (struct source_stream *);
void getl_clear_include_path (struct source_stream *);
#include <libpspp/copyleft.h>
#include <data/format.h>
#include <data/settings.h>
+#include <data/file-name.h>
#include <libpspp/getl.h>
#include <getopt.h>
fmt_init();
settings_init();
- the_source_stream = create_source_stream ();
+ the_source_stream = create_source_stream (
+ fn_getenv_default ("STAT_INCLUDE_PATH", include_path)
+ );
+
message_dialog_init (the_source_stream);
the_dictionary = psppire_dict_new();
if ( !xml ) return 1;
data_editor = get_widget_assert(xml, "data_editor");
- gtk_window_set_icon_from_file(GTK_WINDOW(data_editor),
+ gtk_window_set_icon_from_file(GTK_WINDOW(data_editor),
PKGDATADIR "/psppicon.png",0);
/* connect the signals in the interface */
data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet"));
gtk_sheet_set_model(var_sheet, G_SHEET_MODEL(var_store));
-
+
gtk_sheet_set_model(data_sheet, G_SHEET_MODEL(data_store));
if (filename)
outp_init ();
fn_init ();
fh_init ();
- the_source_stream = create_source_stream ();
+ the_source_stream =
+ create_source_stream (
+ fn_getenv_default ("STAT_INCLUDE_PATH", include_path)
+ );
prompt_init ();
readln_initialize ();
settings_init ();
random_init ();
the_dataset = create_dataset ();
- if (parse_command_line (argc, argv, the_source_stream))
+ if (parse_command_line (argc, argv, the_source_stream))
{
msg_ui_init (the_source_stream);
outp_read_devices ();
for (;;)
{
- int result = cmd_parse (the_lexer, the_dataset,
+ int result = cmd_parse (the_lexer, the_dataset,
proc_has_source (the_dataset)
? CMD_STATE_DATA : CMD_STATE_INITIAL);
if (result == CMD_EOF || result == CMD_FINISH)
break;
- if (result == CMD_CASCADING_FAILURE &&
+ if (result == CMD_CASCADING_FAILURE &&
!getl_is_interactive (the_source_stream))
{
msg (SE, _("Stopping syntax file processing here to avoid "