static void pqueue_destroy (struct pqueue *);
static bool pqueue_is_full (const struct pqueue *);
static bool pqueue_is_empty (const struct pqueue *);
static void pqueue_destroy (struct pqueue *);
static bool pqueue_is_full (const struct pqueue *);
static bool pqueue_is_empty (const struct pqueue *);
- sort->merge = merge_create (ordering, value_cnt);
- sort->pqueue = pqueue_create (ordering, value_cnt);
+ sort->merge = merge_create (ordering, proto);
+ sort->pqueue = pqueue_create (ordering, proto);
pqueue_destroy (sort->pqueue);
casewriter_destroy (sort->run);
case_unref (sort->run_end);
pqueue_destroy (sort->pqueue);
casewriter_destroy (sort->run);
case_unref (sort->run_end);
struct casereader *
sort_execute (struct casereader *input, const struct subcase *ordering)
{
struct casewriter *output =
struct casereader *
sort_execute (struct casereader *input, const struct subcase *ordering)
{
struct casewriter *output =
casereader_transfer (input, output);
return casewriter_make_reader (output);
}
/* Reads all the cases from INPUT. Sorts the cases in ascending
order according to VARIABLE. Returns the sorted cases in a
casereader_transfer (input, output);
return casewriter_make_reader (output);
}
/* Reads all the cases from INPUT. Sorts the cases in ascending
order according to VARIABLE. Returns the sorted cases in a
{
struct pqueue *pq;
pq = xmalloc (sizeof *pq);
subcase_clone (&pq->ordering, ordering);
{
struct pqueue *pq;
pq = xmalloc (sizeof *pq);
subcase_clone (&pq->ordering, ordering);
if (pq->record_cap > max_buffers)
pq->record_cap = max_buffers;
else if (pq->record_cap < min_buffers)
if (pq->record_cap > max_buffers)
pq->record_cap = max_buffers;
else if (pq->record_cap < min_buffers)