02110-1301, USA. */
#include <config.h>
+
#include <language/line-buffer.h>
-#include <libpspp/message.h>
+
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
-#include <libpspp/alloc.h>
-#include <language/command.h>
-#include <libpspp/message.h>
+
#include <data/file-name.h>
-#include <language/lexer/lexer.h>
#include <data/settings.h>
-#include <libpspp/str.h>
-#include <output/table.h>
#include <data/variable.h>
+#include <language/command.h>
+#include <language/lexer/lexer.h>
+#include <libpspp/alloc.h>
+#include <libpspp/message.h>
+#include <libpspp/message.h>
+#include <libpspp/str.h>
+#include <libpspp/verbose-msg.h>
#include <libpspp/version.h>
+#include <output/table.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
void
getl_initialize (void)
{
- ds_create (&getl_include_path,
- fn_getenv_default ("STAT_INCLUDE_PATH", include_path));
- ds_init (&getl_buf, 256);
+ ds_init_cstr (&getl_include_path,
+ fn_getenv_default ("STAT_INCLUDE_PATH", include_path));
+ ds_init_empty (&getl_buf);
init_prompts ();
}
getl_add_include_dir (const char *path)
{
if (ds_length (&getl_include_path))
- ds_putc (&getl_include_path, ':');
+ ds_put_char (&getl_include_path, ':');
- ds_puts (&getl_include_path, path);
+ ds_put_cstr (&getl_include_path, path);
}
/* Appends source S to the list of source files. */
{
if (cur_source != NULL)
{
- char *found_fn = fn_search_path (fn, ds_c_str (&getl_include_path),
+ char *found_fn = fn_search_path (fn, ds_cstr (&getl_include_path),
fn_dir_name (cur_source->fn));
if (found_fn != NULL)
{
do
{
s->ln++;
- if (!ds_gets (line, s->u.syntax_file))
+ if (!ds_read_line (line, s->u.syntax_file))
{
if (ferror (s->u.syntax_file))
msg (ME, _("Reading `%s': %s."), s->fn, strerror (errno));
}
ds_chomp (line, '\n');
}
- while (s->ln == 1 && !memcmp (ds_c_str (line), "#!", 2));
+ while (s->ln == 1 && !memcmp (ds_cstr (line), "#!", 2));
/* Echo to listing file, if configured to do so. */
if (get_echo ())
- tab_output_text (TAB_LEFT | TAB_FIX, ds_c_str (line));
+ tab_output_text (TAB_LEFT | TAB_FIX, ds_cstr (line));
return true;
}