projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
str: Change "char" to "byte" in function names.
[pspp-builds.git]
/
src
/
language
/
data-io
/
get-data.c
diff --git
a/src/language/data-io/get-data.c
b/src/language/data-io/get-data.c
index e4ab76a9992739c78a36f6ad2a98c4f6e0b48d83..9be7a2d634c0282a0e5e212130929a441dacfdfe 100644
(file)
--- a/
src/language/data-io/get-data.c
+++ b/
src/language/data-io/get-data.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009
, 2010
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
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
@@
-219,7
+219,6
@@
parse_get_gnm (struct lexer *lexer, struct dataset *ds)
}
else
{
}
else
{
- printf ("Unknown data file type \"\%s\"\n", lex_tokid (lexer));
goto error;
}
lex_get (lexer);
goto error;
}
lex_get (lexer);
@@
-271,7
+270,7
@@
static int
parse_get_txt (struct lexer *lexer, struct dataset *ds)
{
struct data_parser *parser = NULL;
parse_get_txt (struct lexer *lexer, struct dataset *ds)
{
struct data_parser *parser = NULL;
- struct dictionary *dict =
NULL
;
+ struct dictionary *dict =
dict_create ()
;
struct file_handle *fh = NULL;
struct dfm_reader *reader = NULL;
struct file_handle *fh = NULL;
struct dfm_reader *reader = NULL;
@@
-288,7
+287,7
@@
parse_get_txt (struct lexer *lexer, struct dataset *ds)
if (fh == NULL)
goto error;
if (fh == NULL)
goto error;
- parser = data_parser_create ();
+ parser = data_parser_create (
dict
);
has_type = false;
data_parser_set_type (parser, DP_DELIMITED);
data_parser_set_span (parser, false);
has_type = false;
data_parser_set_type (parser, DP_DELIMITED);
data_parser_set_span (parser, false);
@@
-312,7
+311,7
@@
parse_get_txt (struct lexer *lexer, struct dataset *ds)
DP_DELIMITED, &has_type);
else
{
DP_DELIMITED, &has_type);
else
{
- lex_error (lexer, _("expecting
FIXED or DELIMITED")
);
+ lex_error (lexer, _("expecting
%s or %s"), "FIXED", "DELIMITED"
);
goto error;
}
if (!ok)
goto error;
}
if (!ok)
@@
-350,7
+349,7
@@
parse_get_txt (struct lexer *lexer, struct dataset *ds)
}
else
{
}
else
{
- lex_error (lexer, _("expecting
LINE or VARIABLES")
);
+ lex_error (lexer, _("expecting
%s or %s"), "LINE", "VARIABLES"
);
goto error;
}
}
goto error;
}
}
@@
-421,11
+420,11
@@
parse_get_txt (struct lexer *lexer, struct dataset *ds)
ds_put_cstr (&hard_seps, "\t");
if (ss_match_string (&s, ss_cstr ("\\\\")))
ds_put_cstr (&hard_seps, "\\");
ds_put_cstr (&hard_seps, "\t");
if (ss_match_string (&s, ss_cstr ("\\\\")))
ds_put_cstr (&hard_seps, "\\");
- while ((c = ss_get_
char
(&s)) != EOF)
+ while ((c = ss_get_
byte
(&s)) != EOF)
if (c == ' ')
soft_seps = " ";
else
if (c == ' ')
soft_seps = " ";
else
- ds_put_
char
(&hard_seps, c);
+ ds_put_
byte
(&hard_seps, c);
data_parser_set_soft_delimiters (parser, ss_cstr (soft_seps));
data_parser_set_hard_delimiters (parser, ds_ss (&hard_seps));
ds_destroy (&hard_seps);
data_parser_set_soft_delimiters (parser, ss_cstr (soft_seps));
data_parser_set_hard_delimiters (parser, ds_ss (&hard_seps));
ds_destroy (&hard_seps);
@@
-459,13
+458,13
@@
parse_get_txt (struct lexer *lexer, struct dataset *ds)
break;
else
{
break;
else
{
- lex_error (lexer, _("expecting
VARIABLES")
);
+ lex_error (lexer, _("expecting
%s"), "VARIABLES"
);
goto error;
}
}
lex_match (lexer, '=');
goto error;
}
}
lex_match (lexer, '=');
- dict = dict_create ();
+
record = 1;
type = data_parser_get_type (parser);
do
record = 1;
type = data_parser_get_type (parser);
do