+/* Returns variable V's attribute set. The caller may examine or
+ modify the attribute set, but must not destroy it. Destroying
+ V, or calling var_set_attributes() on V, will also destroy its
+ attribute set. */
+struct attrset *
+var_get_attributes (const struct variable *v)
+{
+ return (struct attrset *) &v->attributes;
+}
+
+/* Replaces variable V's attributes set by a copy of ATTRS. */
+void
+var_set_attributes (struct variable *v, const struct attrset *attrs)
+{
+ attrset_destroy (&v->attributes);
+ attrset_clone (&v->attributes, attrs);
+}
+
+/* Returns true if V has any custom attributes, false if it has none. */
+bool
+var_has_attributes (const struct variable *v)
+{
+ return attrset_count (&v->attributes) > 0;
+}
+\f