#include <config.h>
-#include <gtk/gtk.h>
-
-
-#include "widget-io.h"
-#include "checkbox-treeview.h"
-#include "descriptives-dialog.h"
+#include "ui/gui/text-data-import-dialog.h"
#include <errno.h>
-
#include <gtk-contrib/psppire-sheet.h>
+#include <gtk/gtk.h>
#include <limits.h>
#include <stdlib.h>
#include <sys/stat.h>
-#include <data/data-in.h>
-#include <data/data-out.h>
-#include <data/format-guesser.h>
-#include <data/value-labels.h>
-#include <language/data-io/data-parser.h>
-#include <language/syntax-string-source.h>
-#include <libpspp/assertion.h>
-#include <libpspp/message.h>
-#include <ui/syntax-gen.h>
-#include <ui/gui/psppire-data-window.h>
-#include <ui/gui/dialog-common.h>
-#include <ui/gui/helper.h>
-#include <ui/gui/psppire-dialog.h>
-#include <ui/gui/psppire-var-sheet.h>
-#include <ui/gui/psppire-var-store.h>
-#include "executor.h"
-
-#include "error.h"
-#include "xalloc.h"
+#include "data/data-in.h"
+#include "data/data-out.h"
+#include "data/format-guesser.h"
+#include "data/value-labels.h"
+#include "language/data-io/data-parser.h"
+#include "language/lexer/lexer.h"
+#include "libpspp/assertion.h"
+#include "libpspp/message.h"
+#include "ui/gui/checkbox-treeview.h"
+#include "ui/gui/descriptives-dialog.h"
+#include "ui/gui/dialog-common.h"
+#include "ui/gui/executor.h"
+#include "ui/gui/helper.h"
+#include "ui/gui/psppire-data-window.h"
+#include "ui/gui/psppire-dialog.h"
+#include "ui/gui/psppire-var-sheet.h"
+#include "ui/gui/psppire-var-store.h"
+#include "ui/gui/widget-io.h"
+#include "ui/syntax-gen.h"
+
+#include "gl/error.h"
+#include "gl/xalloc.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
switch (ia->asst.response)
{
case GTK_RESPONSE_APPLY:
- {
- char *syntax = generate_syntax (ia);
- execute_syntax (create_syntax_string_source (syntax));
- free (syntax);
- }
+ free (execute_syntax_string (generate_syntax (ia)));
break;
case PSPPIRE_RESPONSE_PASTE:
- {
- char *syntax = generate_syntax (ia);
- paste_syntax_to_window (syntax);
- free (syntax);
- }
+ free (paste_syntax_to_window (generate_syntax (ia)));
break;
default:
break;
const struct val_lab *vl = labels[i];
ds_put_cstr (s, "\n ");
syntax_gen_value (s, &vl->value, width, format);
- ds_put_char (s, ' ');
+ ds_put_byte (s, ' ');
syntax_gen_string (s, ss_cstr (val_lab_get_label (vl)));
}
free (labels);
if (ia->first_line.skip_lines > 0)
ds_put_format (&s, " /FIRSTCASE=%d\n", ia->first_line.skip_lines + 1);
ds_put_cstr (&s, " /DELIMITERS=\"");
- if (ds_find_char (&ia->separators.separators, '\t') != SIZE_MAX)
+ if (ds_find_byte (&ia->separators.separators, '\t') != SIZE_MAX)
ds_put_cstr (&s, "\\t");
- if (ds_find_char (&ia->separators.separators, '\\') != SIZE_MAX)
+ if (ds_find_byte (&ia->separators.separators, '\\') != SIZE_MAX)
ds_put_cstr (&s, "\\\\");
for (i = 0; i < ds_length (&ia->separators.separators); i++)
{
if (c == '"')
ds_put_cstr (&s, "\"\"");
else if (c != '\t' && c != '\\')
- ds_put_char (&s, c);
+ ds_put_byte (&s, c);
}
ds_put_cstr (&s, "\"\n");
if (!ds_is_empty (&ia->separators.quotes))
clear_fields (ia);
/* Is space in the set of separators? */
- space_sep = ss_find_char (ds_ss (&s->separators), ' ') != SIZE_MAX;
+ space_sep = ss_find_byte (ds_ss (&s->separators), ' ') != SIZE_MAX;
/* Split all the lines, not just those from
ia->first_line.skip_lines on, so that we split the line that
field = text;
}
else if (!ds_is_empty (&s->quotes)
- && ds_find_char (&s->quotes, text.string[0]) != SIZE_MAX)
+ && ds_find_byte (&s->quotes, text.string[0]) != SIZE_MAX)
{
- int quote = ss_get_char (&text);
+ int quote = ss_get_byte (&text);
if (!s->escape)
ss_get_until (&text, quote, &field);
else
int c;
ds_init_empty (&s);
- while ((c = ss_get_char (&text)) != EOF)
+ while ((c = ss_get_byte (&text)) != EOF)
if (c != quote)
- ds_put_char (&s, c);
- else if (ss_match_char (&text, quote))
- ds_put_char (&s, quote);
+ ds_put_byte (&s, c);
+ else if (ss_match_byte (&text, quote))
+ ds_put_byte (&s, quote);
else
break;
field = ds_ss (&s);
}
}
else
- ss_get_chars (&text, ss_cspan (text, ds_ss (&s->separators)),
+ ss_get_bytes (&text, ss_cspan (text, ds_ss (&s->separators)),
&field);
if (column_idx >= s->column_cnt)
ss_ltrim (&text, ss_cstr (" "));
if (ss_is_empty (text))
break;
- if (ss_find_char (ds_ss (&s->separators), ss_first (text))
+ if (ss_find_byte (ds_ss (&s->separators), ss_first (text))
!= SIZE_MAX)
ss_advance (&text, 1);
}
if (max_count > 0)
{
ds_clear (result);
- ds_put_char (result, max);
+ ds_put_byte (result, max);
}
else
ds_assign_cstr (result, def);
}
}
- ds_put_char (&custom, c);
+ ds_put_byte (&custom, c);
next:;
}
const struct separator *sep = &separators[i];
GtkWidget *button = get_widget_assert (ia->asst.builder, sep->name);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
- ds_put_char (&s->separators, sep->c);
+ ds_put_byte (&s->separators, sep->c);
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (s->custom_cb)))
gint width;
ds_init_empty (&s);
- ds_put_char_multiple (&s, '0', char_cnt);
- ds_put_char (&s, ' ');
+ ds_put_byte_multiple (&s, '0', char_cnt);
+ ds_put_byte (&s, ' ');
width = get_string_width (treeview, renderer, ds_cstr (&s));
ds_destroy (&s);