X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fprocedure.c;h=b237c68b05eae06e38db25d3fdf30162dac75b9c;hb=2bdde1cd21cd58349cf4bd852fddf40524854288;hp=6a891c9baff9d14f47f90350827d5406c65c19a8;hpb=b5a51d1c0bc3eda065002dd505cade85f4d75514;p=pspp-builds.git diff --git a/src/data/procedure.c b/src/data/procedure.c index 6a891c9b..b237c68b 100644 --- a/src/data/procedure.c +++ b/src/data/procedure.c @@ -636,6 +636,18 @@ proc_has_active_file (const struct dataset *ds) return ds->source != NULL; } +/* Returns the active file data source from DS, or a null pointer + if DS has no data source, and removes it from DS. */ +struct casereader * +proc_extract_active_file_data (struct dataset *ds) +{ + struct casereader *reader = ds->source; + ds->source = NULL; + if (ds->replace_source) ds->replace_source (reader); + + return reader; +} + /* Checks whether DS has a corrupted active file. If so, discards it and returns false. If not, returns true without doing anything. */