+/*
+ Return a value from a variable that is an interaction.
+ */
+struct interaction_value *
+interaction_case_data (const struct ccase *ccase, const struct interaction_variable *iv)
+{
+ size_t i;
+ size_t n_vars;
+ const struct variable *member;
+ const union value **vals = NULL;
+
+ n_vars = interaction_get_n_vars (iv);
+ vals = xnmalloc (n_vars, sizeof (*vals));
+
+ for (i = 0; i < n_vars; i++)
+ {
+ member = interaction_get_member (iv, i);
+ vals[i] = case_data (ccase, member);
+ }
+
+ return interaction_value_create (iv, vals);
+}
+
+bool
+is_interaction (const struct variable *var, const struct interaction_variable **iv, size_t n_intr)
+{
+ size_t i;
+ const struct variable *intr;
+
+ for (i = 0; i < n_intr; i++)
+ {
+ intr = interaction_get_variable (iv[i]);
+ if (var_get_dict_index (intr) == var_get_dict_index (var))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+