From 1f7e42084393a7b65296e1ac815e1a19184cd56f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 2 May 2006 22:52:33 +0000 Subject: [PATCH] Continue reforming procedure execution. In this phase, add some new, needed functionality to storage-stream. --- src/data/storage-stream.c | 15 +++++++++++++++ src/data/storage-stream.h | 1 + 2 files changed, 16 insertions(+) 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 */ -- 2.30.2