/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#if HAVE_READLINE
rl_basic_word_break_characters = "\n";
-#ifdef unix
+ using_history ();
+ stifle_history (500);
if (history_file == NULL)
{
- history_file = tilde_expand ("~/.pspp_history");
- using_history ();
- read_history (history_file);
- stifle_history (500);
+ const char *home_dir = getenv ("HOME");
+ if (home_dir != NULL)
+ {
+ history_file = xasprintf ("%s/.pspp_history", home_dir);
+ read_history (history_file);
+ }
}
#endif
-#endif
}
/* Close getl. */
{
initialised = false;
-#if HAVE_READLINE && unix
+#if HAVE_READLINE
if (history_file != NULL && false == get_testing_mode() )
write_history (history_file);
clear_history ();
static bool
-read_interactive (struct getl_interface *s, struct string *line)
+read_interactive (struct getl_interface *s,
+ struct string *line, enum getl_syntax *syntax)
{
struct readln_source *is =
(struct readln_source *) s ;
+ *syntax = GETL_INTERACTIVE;
return is->interactive_func (line, prompt_get_style ());
}
"conditions.\nThere is ABSOLUTELY NO WARRANTY for PSPP; type \"show "
"warranty.\" for details.\n", stdout);
puts (stat_version);
-
-#if HAVE_READLINE && unix
- if (history_file == NULL)
- {
- history_file = tilde_expand ("~/.pspp_history");
- using_history ();
- read_history (history_file);
- stifle_history (500);
- }
-#endif
+ readln_initialize ();
}
-
-
-
-
-
/* Gets a line from the user and stores it into LINE.
Prompts the user with PROMPT.
Returns true if successful, false at end of file.