X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fsubcase.c;h=bac32ddefb21eb0fc2e1fde395c08bfc0575e188;hb=cf71798b24ff962626361e13b27747ce58bf3200;hp=32056215e4ace37d4fcd9b544c3e48c493d82dec;hpb=4e57d32680bf79fc93f7cd0d5b92a2c713211972;p=pspp diff --git a/src/data/subcase.c b/src/data/subcase.c index 32056215e4..bac32ddefb 100644 --- a/src/data/subcase.c +++ b/src/data/subcase.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -201,6 +201,30 @@ subcase_add_proto_always (struct subcase *sc, const struct caseproto *proto) invalidate_proto (sc); } +void +subcase_concat (struct subcase *sc, const struct subcase *other) +{ + size_t i; + + for (i = 0; i < other->n_fields; i++) + { + const struct subcase_field *f = &other->fields[i]; + subcase_add (sc, f->case_index, f->width, f->direction); + } +} + +void +subcase_concat_always (struct subcase *sc, const struct subcase *other) +{ + size_t i; + + for (i = 0; i < other->n_fields; i++) + { + const struct subcase_field *f = &other->fields[i]; + subcase_add_always (sc, f->case_index, f->width, f->direction); + } +} + /* Obtains a caseproto for a case described by SC. The caller must not modify or unref the returned case prototype. */ const struct caseproto *