-/* Returns V's auxiliary data, or a null pointer if none has been
- attached. */
-void *
-var_get_aux (const struct variable *v)
-{
- return v->aux;
-}
-
-/* Assign auxiliary data AUX to variable V, which must not
- already have auxiliary data. Before V's auxiliary data is
- cleared, AUX_DTOR(V) will be called. (var_dtor_free, below,
- may be appropriate for use as AUX_DTOR.) */
-void *
-var_attach_aux (const struct variable *v_,
- void *aux, void (*aux_dtor) (struct variable *))
-{
- struct variable *v = CONST_CAST (struct variable *, v_);
- assert (v->aux == NULL);
- assert (aux != NULL);
- v->aux = aux;
- v->aux_dtor = aux_dtor;
- return aux;
-}
-
-/* Remove auxiliary data, if any, from V, and return it, without
- calling any associated destructor. */
-void *
-var_detach_aux (struct variable *v)
-{
- void *aux = v->aux;
- assert (aux != NULL);
- v->aux = NULL;
- return aux;
-}
-
-/* Clears auxiliary data, if any, from V, and calls any
- associated destructor. */
-void
-var_clear_aux (struct variable *v)
-{
- if (v->aux != NULL)
- {
- if (v->aux_dtor != NULL)
- v->aux_dtor (v);
- v->aux = NULL;
- }
-}
-
-/* This function is appropriate for use an auxiliary data
- destructor (passed as AUX_DTOR to var_attach_aux()) for the
- case where the auxiliary data should be passed to free(). */
-void
-var_dtor_free (struct variable *v)
-{
- free (v->aux);
-}
-\f
-/* Observed categorical values. */
-
-/* Returns V's observed categorical values,
- which V must have. */
-struct cat_vals *
-var_get_obs_vals (const struct variable *v)
-{
- assert (v->obs_vals != NULL);
- return v->obs_vals;
-}
-
-/* Sets V's observed categorical values to CAT_VALS.
- V becomes the owner of CAT_VALS. */
-void
-var_set_obs_vals (const struct variable *v_, struct cat_vals *cat_vals)
-{
- struct variable *v = CONST_CAST (struct variable *, v_ );
- cat_stored_values_destroy (v->obs_vals);
- v->obs_vals = cat_vals;
-}
-
-/* Returns true if V has observed categorical values,
- false otherwise. */
-bool
-var_has_obs_vals (const struct variable *v)
-{
- return v->obs_vals != NULL;
-}
-\f