-static int write_wim_resource(const struct lookup_table_entry *lte,
- FILE *out_fp, int out_ctype)
+/*
+ * Writes a WIM resource to a FILE * opened for writing. The resource may be
+ * written uncompressed or compressed depending on the @out_ctype parameter.
+ *
+ * @lte: The lookup table entry for the WIM resource.
+ * @out_fp: The FILE * to write the resource to.
+ * @out_ctype: The compression type of the resource to write. Note: if this is
+ * the same as the compression type of the WIM resource we
+ * need to read, we simply copy the data (i.e. we do not
+ * uncompress it, then compress it again).
+ * @out_res_entry: If non-NULL, a resource entry that is filled in with the
+ * offset, original size, compressed size, and compression flag
+ * of the output resource.
+ *
+ * Returns 0 on success; nonzero on failure.
+ */
+static int __write_wim_resource(const struct lookup_table_entry *lte,
+ FILE *out_fp, int out_ctype,
+ struct resource_entry *out_res_entry)