X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fsubcase.c;fp=src%2Fdata%2Fsubcase.c;h=36ee9bf32758177ce79b37994058db5a53ed8e61;hb=392c853531c97fd8192cea98ab7c8e067436bf8b;hp=bac32ddefb21eb0fc2e1fde395c08bfc0575e188;hpb=60482369abb7fa5b624e99bebf7d8a549b3a3718;p=pspp diff --git a/src/data/subcase.c b/src/data/subcase.c index bac32ddefb..36ee9bf327 100644 --- a/src/data/subcase.c +++ b/src/data/subcase.c @@ -163,6 +163,17 @@ subcase_add_var_always (struct subcase *sc, const struct variable *var, var_get_width (var), direction); } +void +subcase_add_vars_always (struct subcase *sc, + const struct variable *const *vars, size_t n_vars, + enum subcase_direction direction) +{ + size_t i; + + for (i = 0; i < n_vars; i++) + subcase_add_var_always (sc, vars[i], direction); +} + /* Add a field for CASE_INDEX, WIDTH to SC, with DIRECTION as the sort order, regardless of whether CASE_INDEX already has a field in SC. */ @@ -225,6 +236,15 @@ subcase_concat_always (struct subcase *sc, const struct subcase *other) } } +void +subcase_project (struct subcase *sc, size_t offset) +{ + size_t i; + + for (i = 0; i < sc->n_fields; i++) + sc->fields[i].case_index = i + offset; +} + /* Obtains a caseproto for a case described by SC. The caller must not modify or unref the returned case prototype. */ const struct caseproto *