- LABEL for it and returns nonzero. Otherwise, returns zero.
- Behavior is undefined if VLS's width is greater than
- MAX_SHORT_STRING. */
-int
-val_labs_add (struct val_labs *vls, union value value, const char *label)
-{
- struct int_val_lab *ivl;
- void **vlpp;
-
- assert (vls != NULL);
- assert (vls->width <= MAX_SHORT_STRING);
- assert (label != NULL);
-
- if (vls->labels == NULL)
- vls->labels = hsh_create (8, compare_int_val_lab, hash_int_val_lab,
- free_int_val_lab, vls);
-
- ivl = create_int_val_lab (vls, value, label);
- vlpp = hsh_probe (vls->labels, ivl);
- if (*vlpp == NULL)
- {
- *vlpp = ivl;
- return 1;
- }
- else
- {
- free_int_val_lab (ivl, vls);
- return 0;
- }
-}
-
-/* Sets LABEL as the value label for VALUE in VLS. Returns zero
- if there wasn't already a value label for VALUE, or nonzero if
- there was. Behavior is undefined if VLS's width is greater
- than MAX_SHORT_STRING. */
-int
-val_labs_replace (struct val_labs *vls, union value value, const char *label)
-{
- struct int_val_lab *ivl;
-
- assert (vls != NULL);
- assert (vls->width <= MAX_SHORT_STRING);
- assert (label != NULL);
-
- if (vls->labels == NULL)
- {
- val_labs_add (vls, value, label);
- return 0;
- }
-
- ivl = hsh_replace (vls->labels, create_int_val_lab (vls, value, label));
- if (ivl == NULL)
- return 0;
- else
- {
- free_int_val_lab (ivl, vls);
- return 1;
- }
-}
-
-/* Removes any value label for VALUE within VLS. Returns nonzero
- if a value label was removed. Behavior is undefined if VLS's
- width is greater than MAX_SHORT_STRING. */
-int
-val_labs_remove (struct val_labs *vls, union value value)