X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fdata-parser.c;h=630363af53f6ce2a077028474dd1d0386bde0fd6;hb=81579d9e9f994fb2908f50af41c3eb033d216e58;hp=714b2a952e32c8d96d29af7c958e6e2c64e40a79;hpb=3da49359c52cb783db907cc197847bbd5e721c97;p=pspp-builds.git diff --git a/src/language/data-io/data-parser.c b/src/language/data-io/data-parser.c index 714b2a95..630363af 100644 --- a/src/language/data-io/data-parser.c +++ b/src/language/data-io/data-parser.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,24 +16,24 @@ #include -#include +#include "language/data-io/data-parser.h" #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "data/casereader-provider.h" +#include "data/data-in.h" +#include "data/dictionary.h" +#include "data/format.h" +#include "data/file-handle-def.h" +#include "data/procedure.h" +#include "data/settings.h" +#include "language/data-io/data-reader.h" +#include "libpspp/message.h" +#include "libpspp/str.h" +#include "output/tab.h" -#include "xalloc.h" +#include "gl/xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -450,19 +450,19 @@ cut_field (const struct data_parser *parser, struct dfm_reader *reader, } *first_column = dfm_column_start (reader); - if (ss_find_char (parser->quotes, ss_first (p)) != SIZE_MAX) + if (ss_find_byte (parser->quotes, ss_first (p)) != SIZE_MAX) { /* Quoted field. */ - int quote = ss_get_char (&p); + int quote = ss_get_byte (&p); if (!ss_get_until (&p, quote, field)) msg (SW, _("Quoted string extends beyond end of line.")); if (parser->quote_escape && ss_first (p) == quote) { ds_assign_substring (tmp, *field); - while (ss_match_char (&p, quote)) + while (ss_match_byte (&p, quote)) { struct substring ss; - ds_put_char (tmp, quote); + ds_put_byte (tmp, quote); if (!ss_get_until (&p, quote, &ss)) msg (SW, _("Quoted string extends beyond end of line.")); ds_put_substring (tmp, ss); @@ -475,17 +475,17 @@ cut_field (const struct data_parser *parser, struct dfm_reader *reader, if present. */ ss_ltrim (&p, parser->soft_seps); if (!ss_is_empty (p) - && ss_find_char (parser->hard_seps, ss_first (p)) != SIZE_MAX) + && ss_find_byte (parser->hard_seps, ss_first (p)) != SIZE_MAX) ss_advance (&p, 1); } else { /* Regular field. */ - ss_get_chars (&p, ss_cspan (p, ds_ss (&parser->any_sep)), field); + ss_get_bytes (&p, ss_cspan (p, ds_ss (&parser->any_sep)), field); *last_column = *first_column + ss_length (*field); if (!ss_ltrim (&p, parser->soft_seps) || ss_is_empty (p) - || ss_find_char (parser->hard_seps, p.string[0]) != SIZE_MAX) + || ss_find_byte (parser->hard_seps, p.string[0]) != SIZE_MAX) { /* Advance past a trailing hard separator, regardless of whether one actually existed. If