+extern int
+skip_wim_stream(struct wim_lookup_table_entry *lte);
+
+/*
+ * Type of callback function for beginning to read a stream.
+ *
+ * @lte:
+ * Stream that is about to be read.
+ *
+ * @ctx:
+ * User-provided context.
+ *
+ * Must return 0 on success, a positive error code on failure, or the special
+ * value BEGIN_STREAM_STATUS_SKIP_STREAM to indicate that the stream should not
+ * be read, and read_stream_list() should continue on to the next stream
+ * (without calling @consume_chunk or @end_stream).
+ */
+typedef int (*read_stream_list_begin_stream_t)(struct wim_lookup_table_entry *lte,
+ void *ctx);
+
+#define BEGIN_STREAM_STATUS_SKIP_STREAM -1
+
+/*
+ * Type of callback function for finishing reading a stream.
+ *
+ * @lte:
+ * Stream that has been fully read, or stream that started being read but
+ * could not be fully read due to a read error.
+ *
+ * @status:
+ * 0 if reading the stream was successful; otherwise a nonzero error code
+ * that specifies the return status.
+ *
+ * @ctx:
+ * User-provided context.
+ */
+typedef int (*read_stream_list_end_stream_t)(struct wim_lookup_table_entry *lte,
+ int status,
+ void *ctx);
+
+
+/* Callback functions and contexts for read_stream_list(). */
+struct read_stream_list_callbacks {
+
+ /* Called when a stream is about to be read. */
+ read_stream_list_begin_stream_t begin_stream;
+
+ /* Called when a chunk of data has been read. */
+ consume_data_callback_t consume_chunk;
+
+ /* Called when a stream has been fully read. A successful call to
+ * @begin_stream will always be matched by a call to @end_stream. */
+ read_stream_list_end_stream_t end_stream;
+
+ /* Parameter passed to @begin_stream. */
+ void *begin_stream_ctx;
+
+ /* Parameter passed to @consume_chunk. */
+ void *consume_chunk_ctx;
+
+ /* Parameter passed to @end_stream. */
+ void *end_stream_ctx;
+};
+
+/* Flags for read_stream_list() */
+#define VERIFY_STREAM_HASHES 0x1
+#define COMPUTE_MISSING_STREAM_HASHES 0x2
+#define STREAM_LIST_ALREADY_SORTED 0x4