void dict_var_resized (const struct variable *v, int old_width);
void dict_var_display_width_changed (const struct variable *v);
+static inline int
+vardict_get_dict_index (const struct vardict_info *vardict)
+{
+ return vardict->dict_index;
+}
+
+static inline int
+vardict_get_case_index (const struct vardict_info *vardict)
+{
+ return vardict->case_index;
+}
+
+static inline struct dictionary *
+vardict_get_dictionary (const struct vardict_info *vardict)
+{
+ return vardict->dict;
+}
+
#endif /* data/vardict.h */
var_get_dict_index (const struct variable *v)
{
assert (var_has_vardict (v));
- return v->vardict->dict_index;
+ return vardict_get_dict_index (v->vardict);
}
/* Returns V's index within the case represented by its
var_get_case_index (const struct variable *v)
{
assert (var_has_vardict (v));
- return v->vardict->case_index;
+ return vardict_get_case_index (v->vardict);
}
\f
/* Returns V's auxiliary data, or a null pointer if none has been
const char *
var_get_encoding (const struct variable *var)
{
- return var_has_vardict (var) ? dict_get_encoding (var->vardict->dict) : NULL;
+ return (var_has_vardict (var)
+ ? dict_get_encoding (vardict_get_dictionary (var->vardict))
+ : NULL);
}
\f
/* Returns V's vardict structure. */
void
var_set_vardict (struct variable *v, struct vardict_info *vardict)
{
- assert (vardict->dict_index >= 0);
- assert (vardict->case_index >= 0);
- assert (vardict->dict != NULL);
v->vardict = vardict;
}