libsparse: add error reporting functions

Change-Id: I2f21355b6c5339d1d724b4c121ea30d575b2d366
diff --git a/libsparse/include/sparse/sparse.h b/libsparse/include/sparse/sparse.h
index 6484333..09a5137 100644
--- a/libsparse/include/sparse/sparse.h
+++ b/libsparse/include/sparse/sparse.h
@@ -157,4 +157,22 @@
 int sparse_file_write(struct sparse_file *s, int fd, bool gz, bool sparse,
 		bool crc);
 
+/**
+ * sparse_file_verbose - set a sparse file cookie to print verbose errors
+ *
+ * @s - sparse file cookie
+ *
+ * Print verbose sparse file errors whenever using the sparse file cookie.
+ */
+void sparse_file_verbose(struct sparse_file *s);
+
+/**
+ * sparse_print_verbose - function called to print verbose errors
+ *
+ * By default, verbose errors will print to standard error.
+ * sparse_print_verbose may be overridden to log verbose errors somewhere else.
+ *
+ */
+extern void (*sparse_print_verbose)(const char *fmt, ...);
+
 #endif