From: Ben Pfaff Date: Tue, 2 May 2006 22:52:33 +0000 (+0000) Subject: Continue reforming procedure execution. In this phase, add some new, X-Git-Tag: v0.6.0~909 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f7e42084393a7b65296e1ac815e1a19184cd56f;p=pspp-builds.git Continue reforming procedure execution. In this phase, add some new, needed functionality to storage-stream. --- diff --git a/src/data/storage-stream.c b/src/data/storage-stream.c index a758c5a1..d1dcd05d 100644 --- a/src/data/storage-stream.c +++ b/src/data/storage-stream.c @@ -160,6 +160,21 @@ storage_source_get_casefile (struct case_source *source) return info->casefile; } +/* Destroys SOURCE and returns the casefile that it + encapsulated. */ +struct casefile * +storage_source_decapsulate (struct case_source *source) +{ + struct storage_stream_info *info = source->aux; + struct casefile *casefile; + + assert (source->class == &storage_source_class); + casefile = info->casefile; + info->casefile = NULL; + destroy_storage_stream_info (info); + return casefile; +} + struct case_source * storage_source_create (struct casefile *cf) { diff --git a/src/data/storage-stream.h b/src/data/storage-stream.h index 0b23331a..92652189 100644 --- a/src/data/storage-stream.h +++ b/src/data/storage-stream.h @@ -27,6 +27,7 @@ extern const struct case_sink_class storage_sink_class; extern const struct case_source_class storage_source_class; struct casefile *storage_source_get_casefile (struct case_source *); +struct casefile *storage_source_decapsulate (struct case_source *); struct case_source *storage_source_create (struct casefile *); #endif /* storage-stream.h */