/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
}
+/* Returns the width of VLS. */
+int
+val_labs_get_width (const struct val_labs *vls)
+{
+ return vls->width;
+}
+
/* Returns the number of value labels in VLS.
Returns 0 if VLS is null. */
size_t
const char *label)
{
struct val_lab *lab = xmalloc (sizeof *lab);
- value_init (&lab->value, vls->width);
- value_copy (&lab->value, value, vls->width);
+ value_clone (&lab->value, value, vls->width);
lab->label = intern_new (label);
hmap_insert (&vls->labels, &lab->node, value_hash (value, vls->width, 0));
}