-/* Ascending numeric compare of values. */
-static int
-compare_value_numeric_a (const void *a_, const void *b_, const void *aux UNUSED)
-{
- const struct freq *a = a_;
- const struct freq *b = b_;
-
- if (a->value[0].f > b->value[0].f)
- return 1;
- else if (a->value[0].f < b->value[0].f)
- return -1;
- else
- return 0;
-}
-
-/* Ascending string compare of values. */
-static int
-compare_value_alpha_a (const void *a_, const void *b_, const void *v_)
-{
- const struct freq *a = a_;
- const struct freq *b = b_;
- const struct variable *v = v_;
- struct var_freqs *vf = get_var_freqs (v);
-
- return memcmp (a->value[0].s, b->value[0].s, vf->width);
-}
-
-/* Descending numeric compare of values. */
-static int
-compare_value_numeric_d (const void *a, const void *b, const void *aux UNUSED)
-{
- return -compare_value_numeric_a (a, b, aux);
-}
-
-/* Descending string compare of values. */
-static int
-compare_value_alpha_d (const void *a, const void *b, const void *v)
-{
- return -compare_value_alpha_a (a, b, v);
-}
-
-/* Ascending numeric compare of frequency;
- secondary key on ascending numeric value. */
-static int
-compare_freq_numeric_a (const void *a_, const void *b_, const void *aux UNUSED)
-{
- const struct freq *a = a_;
- const struct freq *b = b_;
-
- if (a->count > b->count)
- return 1;
- else if (a->count < b->count)
- return -1;
-
- if (a->value[0].f > b->value[0].f)
- return 1;
- else if (a->value[0].f < b->value[0].f)
- return -1;
- else
- return 0;
-}
-
-/* Ascending numeric compare of frequency;
- secondary key on ascending string value. */
-static int
-compare_freq_alpha_a (const void *a_, const void *b_, const void *v_)
-{
- const struct freq *a = a_;
- const struct freq *b = b_;
- const struct variable *v = v_;
- struct var_freqs *vf = get_var_freqs (v);
-
- if (a->count > b->count)
- return 1;
- else if (a->count < b->count)
- return -1;
- else
- return memcmp (a->value[0].s, b->value[0].s, vf->width);
-}
-
-/* Descending numeric compare of frequency;
- secondary key on ascending numeric value. */
-static int
-compare_freq_numeric_d (const void *a_, const void *b_, const void *aux UNUSED)
-{
- const struct freq *a = a_;
- const struct freq *b = b_;
-
- if (a->count > b->count)
- return -1;
- else if (a->count < b->count)
- return 1;
-
- if (a->value[0].f > b->value[0].f)
- return 1;
- else if (a->value[0].f < b->value[0].f)
- return -1;
- else
- return 0;
-}
-
-/* Descending numeric compare of frequency;
- secondary key on ascending string value. */
-static int
-compare_freq_alpha_d (const void *a_, const void *b_, const void *v_)
-{
- const struct freq *a = a_;
- const struct freq *b = b_;
- const struct variable *v = v_;
- struct var_freqs *vf = get_var_freqs (v);
-
- if (a->count > b->count)
- return -1;
- else if (a->count < b->count)
- return 1;
- else
- return memcmp (a->value[0].s, b->value[0].s, vf->width);
-}