flip->error = false;
flip->dict = dict;
- lex_match (lexer, '/');
+ lex_match (lexer, T_SLASH);
if (lex_match_id (lexer, "VARIABLES"))
{
- lex_match (lexer, '=');
+ lex_match (lexer, T_EQUALS);
if (!parse_variables_const (lexer, dict, &vars, &flip->n_vars,
PV_NO_DUPLICATE))
goto error;
- lex_match (lexer, '/');
+ lex_match (lexer, T_SLASH);
}
else
dict_get_vars (dict, &vars, &flip->n_vars, DC_SYSTEM);
pool_register (flip->pool, free, vars);
- lex_match (lexer, '/');
+ lex_match (lexer, T_SLASH);
if (lex_match_id (lexer, "NEWNAMES"))
{
- lex_match (lexer, '=');
+ lex_match (lexer, T_EQUALS);
flip->new_names_var = parse_variable (lexer, dict);
if (!flip->new_names_var)
goto error;
}
}
- flip->file = pool_tmpfile (flip->pool);
+ flip->file = pool_create_temp_file (flip->pool);
if (flip->file == NULL)
{
msg (SE, _("Could not create temporary file for FLIP."));
{
name = data_out_pool (value, dict_get_encoding (flip->dict), var_get_write_format (flip->new_names_var),
flip->pool);
-
}
var_names_add (flip->pool, &flip->new_names, name);
}
*cp = '_';
}
*cp = '\0';
- str_uppercase (name);
/* Use the mangled name, if it is available, or add numeric
extensions until we find one that is. */
return false;
}
- output_file = pool_tmpfile (flip->pool);
+ output_file = pool_create_temp_file (flip->pool);
if (output_file == NULL)
{
msg (SE, _("Error creating FLIP source file."));
case_idx += read_cases;
}
- if (pool_fclose (flip->pool, input_file) == EOF)
- {
- msg (SE, _("Error closing FLIP source file: %s."), strerror (errno));
- return false;
- }
+ pool_fclose_temp_file (flip->pool, input_file);
pool_unregister (flip->pool, input_buf);
free (input_buf);
flip_casereader_read (struct casereader *reader, void *flip_)
{
struct flip_pgm *flip = flip_;
+ const char *encoding;
struct ccase *c;
size_t i;
return false;
c = case_create (casereader_get_proto (reader));
- data_in (ss_cstr (flip->old_names.names[flip->cases_read]), dict_get_encoding (flip->dict),
- FMT_A, 0,
- 0, 0,
- flip->dict,
- case_data_rw_idx (c, 0), 8);
-
+ encoding = dict_get_encoding (flip->dict);
+ data_in (ss_cstr (flip->old_names.names[flip->cases_read]), encoding,
+ FMT_A, case_data_rw_idx (c, 0), 8, encoding);
+
for (i = 0; i < flip->n_cases; i++)
{
double in;