goto error;
case_create (&pgm->bounce, dict_get_next_value_idx (dict));
-
+
start_case_map (dict);
while (lex_token (lexer) != '.')
}
pgm->map = finish_case_map (dict);
-
- dict_destroy (dataset_dict (ds));
+
dataset_set_dict (ds, dict);
- proc_set_source (ds,
+ proc_set_source (ds,
create_case_source (&case_reader_source_class, pgm));
return CMD_SUCCESS;
struct mtf_file *next_min; /* Next in the chain of minimums. */
int type; /* One of MTF_*. */
- struct variable **by; /* List of BY variables for this file. */
+ const struct variable **by; /* List of BY variables for this file. */
struct file_handle *handle; /* File handle. */
struct any_reader *reader; /* File reader. */
struct dictionary *dict; /* Dictionary from system file. */
{
if (lex_match (lexer, T_BY))
{
- struct variable **by;
+ const struct variable **by;
if (mtf.by_cnt)
{
}
lex_match (lexer, '=');
- if (!parse_variables (lexer, mtf.dict, &by, &mtf.by_cnt,
+ if (!parse_variables_const (lexer, mtf.dict, &by, &mtf.by_cnt,
PV_NO_DUPLICATE | PV_NO_SCRATCH))
goto error;
if (used_active_file)
{
proc_set_sink (ds, create_case_sink (&null_sink_class,
- dataset_dict (ds), NULL));
+ dataset_dict (ds),
+ dataset_get_casefile_factory (ds),
+ NULL));
proc_open (ds);
}
else
discard_variables (ds);
dict_compact_values (mtf.dict);
- mtf.output = fastfile_create (dict_get_next_value_idx (mtf.dict));
+ mtf.output = dataset_get_casefile_factory (ds)->create_casefile
+ (dataset_get_casefile_factory (ds),
+ dict_get_next_value_idx (mtf.dict));
+
mtf.seq_nums = xcalloc (dict_get_var_cnt (mtf.dict), sizeof *mtf.seq_nums);
case_create (&mtf.mtf_case, dict_get_next_value_idx (mtf.dict));
discard_variables (ds);
- dict_destroy (dataset_dict (ds));
dataset_set_dict (ds, mtf.dict);
mtf.dict = NULL;
proc_set_source (ds, storage_source_create (mtf.output));
mtf.output = NULL;
-
+
return mtf_free (&mtf) ? CMD_SUCCESS : CMD_CASCADING_FAILURE;
-
+
error:
proc_close (ds);
mtf_free (&mtf);
dict_set_documents (m, d_docs);
else
{
- char *new_docs;
- size_t new_len;
-
- new_len = strlen (m_docs) + strlen (d_docs);
- new_docs = xmalloc (new_len + 1);
- strcpy (new_docs, m_docs);
- strcat (new_docs, d_docs);
+ char *new_docs = xasprintf ("%s%s", m_docs, d_docs);
dict_set_documents (m, new_docs);
free (new_docs);
}