for (i = 0; i < cm->n_inputs; i++)
{
struct case_matcher_input *input = &cm->inputs[i];
- subcase_destroy (&input->by_vars);
+ subcase_uninit (&input->by_vars);
}
free (cm->inputs);
free (cm);
struct subcase *sc = sc_;
if (sc != NULL)
{
- subcase_destroy (sc);
+ subcase_uninit (sc);
free (sc);
}
}
destroy_projection (void *project_)
{
struct casereader_project *project = project_;
- subcase_destroy (&project->old_sc);
- subcase_destroy (&project->new_sc);
+ subcase_uninit (&project->old_sc);
+ subcase_uninit (&project->new_sc);
free (project);
return true;
}
subcase_init (&sc, column, caseproto_get_width (subproto, column),
SC_ASCEND);
reader = casereader_project (subreader, &sc);
- subcase_destroy (&sc);
+ subcase_uninit (&sc);
return reader;
}
/* Frees the memory owned by SC (but not SC itself). */
void
-subcase_destroy (struct subcase *sc)
+subcase_uninit (struct subcase *sc)
{
free (sc->fields);
caseproto_unref (sc->proto);
void subcase_clone (struct subcase *, const struct subcase *);
void subcase_clear (struct subcase *);
-void subcase_destroy (struct subcase *);
+void subcase_uninit (struct subcase *);
bool subcase_contains (const struct subcase *, int case_index);
bool subcase_contains_var (const struct subcase *, const struct variable *);
for (i = 0; i < proc->n_files; i++)
{
struct comb_file *file = &proc->files[i];
- subcase_destroy (&file->by_vars);
- subcase_destroy (&file->src);
- subcase_destroy (&file->dst);
+ subcase_uninit (&file->by_vars);
+ subcase_uninit (&file->src);
+ subcase_uninit (&file->dst);
free (file->mv);
fh_unref (file->handle);
dict_unref (file->dict);
proc->prev_BY);
free (proc->prev_BY);
}
- subcase_destroy (&proc->by_vars);
+ subcase_uninit (&proc->by_vars);
case_unref (proc->buffered_case);
}
\f
ok = casegrouper_destroy (grouper);
ok = proc_commit (ds) && ok;
- subcase_destroy (&sc);
+ subcase_uninit (&sc);
free (lcmd->v_variables);
return ok ? CMD_SUCCESS : CMD_CASCADING_FAILURE;
{
struct agr_var *iter, *next;
- subcase_destroy (&agr->sort);
+ subcase_uninit (&agr->sort);
free (agr->break_vars);
for (iter = agr->agr_vars; iter; iter = next)
{
subcase_init_var (&ordering, iter->subject, SC_ASCEND);
iter->writer = sort_create_writer (&ordering, proto);
- subcase_destroy (&ordering);
+ subcase_uninit (&ordering);
caseproto_unref (proto);
iter->cc = 0;
es[v].minimum = DBL_MAX;
}
- subcase_destroy (&ordering);
+ subcase_uninit (&ordering);
return es;
}
ok = proc_commit (ds) && ok;
}
- subcase_destroy (&graph.ordering);
+ subcase_uninit (&graph.ordering);
free (graph.dep_vars);
pool_destroy (graph.pool);
caseproto_unref (graph.gr_proto);
return CMD_SUCCESS;
error:
- subcase_destroy (&graph.ordering);
+ subcase_uninit (&graph.ordering);
caseproto_unref (graph.gr_proto);
free (graph.dep_vars);
pool_destroy (graph.pool);
cc += dict_get_case_weight (dict, c, &warn);
casewriter_write (writer, c);
}
- subcase_destroy (&sc);
+ subcase_uninit (&sc);
casereader_destroy (rr);
rr = casewriter_make_reader (writer);
{
free (rank->vars);
free (rank->group_vars);
- subcase_destroy (&rank->sc);
+ subcase_uninit (&rank->sc);
pool_destroy (rank->pool);
}
/* Do ranking. */
subcase_init (&input_var, 0, 0, SC_ASCEND);
tie_grouper = casegrouper_create_subcase (input, &input_var);
- subcase_destroy (&input_var);
+ subcase_uninit (&input_var);
for (; casegrouper_get_next_group (tie_grouper, &tied_cases);
casereader_destroy (tied_cases))
{
for (i = 0; i < cmd->n_vars; i++)
outputs[i] = sort_create_writer (&by_order, output_proto);
- subcase_destroy (&by_order);
+ subcase_uninit (&by_order);
caseproto_unref (output_proto);
}
else
weight_idx = -1;
input_pass = casereader_project (input_pass, &projection);
- subcase_destroy (&projection);
+ subcase_uninit (&projection);
/* Prepare 'group_vars' as the set of grouping variables. */
subcase_init_empty (&group_vars);
var_get_width (dict_get_split_vars (d)[j]),
SC_ASCEND);
split_grouper = casegrouper_create_subcase (input_pass, &split_vars);
- subcase_destroy (&split_vars);
+ subcase_uninit (&split_vars);
while (casegrouper_get_next_group (split_grouper, &split_group))
{
struct casereader *ordered;
rank_sorted_file (by_group, outputs[i], weight_idx, cmd);
ok = casegrouper_destroy (by_grouper) && ok;
}
- subcase_destroy (&group_vars);
- subcase_destroy (&rank_ordering);
+ subcase_uninit (&group_vars);
+ subcase_uninit (&rank_ordering);
ok = casegrouper_destroy (split_grouper) && ok;
}
}
caseproto_unref (proto);
- subcase_destroy (&ordering);
+ subcase_uninit (&ordering);
}
for (; (c = casereader_read (r)) != NULL; case_unref (c))
casereader_destroy (negatives);
caseproto_unref (n_proto);
- subcase_destroy (&up_ordering);
- subcase_destroy (&down_ordering);
+ subcase_uninit (&up_ordering);
+ subcase_uninit (&down_ordering);
output_roc (rs, roc);
cc += w;
casewriter_write (writer, c);
}
- subcase_destroy (&sc);
+ subcase_uninit (&sc);
casereader_destroy (reader);
reader = casewriter_make_reader (writer);
min_buffers = 64;
max_buffers = INT_MAX;
- subcase_destroy (&ordering);
+ subcase_uninit (&ordering);
return ok ? CMD_SUCCESS : CMD_CASCADING_FAILURE;
}
subcase_init_var (&ordering, ws[i].absdiff, SC_ASCEND);
writer = sort_create_writer (&ordering, proto);
- subcase_destroy (&ordering);
+ subcase_uninit (&ordering);
for (; (c = casereader_read (r)) != NULL; case_unref (c))
{
{
size_t i;
- subcase_destroy (&m->ordering);
+ subcase_uninit (&m->ordering);
for (i = 0; i < m->n_inputs; i++)
casereader_destroy (m->inputs[i].reader);
caseproto_unref (m->proto);
{
struct sort_writer *sort = sort_;
- subcase_destroy (&sort->ordering);
+ subcase_uninit (&sort->ordering);
merge_destroy (sort->merge);
pqueue_destroy (sort->pqueue);
casewriter_destroy (sort->run);
subcase_init_var (&sc, var, SC_ASCEND);
reader = sort_execute (input, &sc);
- subcase_destroy (&sc);
+ subcase_uninit (&sc);
return reader;
}
\f
struct ccase *c = pqueue_pop (pq, &id);
case_unref (c);
}
- subcase_destroy (&pq->ordering);
+ subcase_uninit (&pq->ordering);
free (pq->records);
free (pq);
}