Continue reforming procedure execution. In this phase, add some new,
authorBen Pfaff <blp@gnu.org>
Tue, 2 May 2006 22:52:33 +0000 (22:52 +0000)
committerBen Pfaff <blp@gnu.org>
Tue, 2 May 2006 22:52:33 +0000 (22:52 +0000)
needed functionality to storage-stream.

src/data/storage-stream.c
src/data/storage-stream.h

index a758c5a1e021e66051778b320203c186b5c21805..d1dcd05d1ad9d9c28535a6ddb7b90ffdafc04d45 100644 (file)
@@ -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)
 {
index 0b23331a0698328189e9dbb396871c6ce7fe2668..92652189827d58a20c506330e970f9cf0420dc21 100644 (file)
@@ -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 */