-
-#if DEBUGGING
-static void
-debug_print ()
-{
- int i;
-
- puts (_("Value labels:"));
- for (i = 0; i < nvar; i++)
- {
- AVLtraverser *t = NULL;
- struct value_label *val;
-
- printf (" %s\n", var[i]->name);
- if (var[i]->val_lab)
- if (var[i]->type == NUMERIC)
- for (val = avltrav (var[i]->val_lab, &t);
- val; val = avltrav (var[i]->val_lab, &t))
- printf (" %g: `%s'\n", val->v.f, val->s);
- else
- for (val = avltrav (var[i]->val_lab, &t);
- val; val = avltrav (var[i]->val_lab, &t))
- printf (" `%.8s': `%s'\n", val->v.s, val->s);
- else
- printf (_(" (no value labels)\n"));
- }
-}
-#endif /* DEBUGGING */
-
-/* Compares two value labels and returns a strcmp()-type result. */
-int
-val_lab_cmp (const void *a, const void *b, void *param)
-{
- if ((int) param)
- return strncmp (((struct value_label *) a)->v.s,
- ((struct value_label *) b)->v.s,
- (int) param);
- else
- {
- int temp = (((struct value_label *) a)->v.f
- - ((struct value_label *) b)->v.f);
- if (temp > 0)
- return 1;
- else if (temp < 0)
- return -1;
- else
- return 0;
- }
-}
-
-/* Callback function to increment the reference count for a value
- label. */
-void *
-inc_ref_count (void *pv, void *param unused)
-{
- ((struct value_label *) pv)->ref_count++;
- return pv;
-}
-
-/* Copy the avl tree of value labels and return a pointer to the
- copy. */
-avl_tree *
-copy_value_labels (avl_tree *src)
-{
- avl_tree *dest;
-
- if (src == NULL)
- return NULL;
- dest = avl_copy (NULL, src, inc_ref_count);
-
- return dest;
-}