summaryrefslogtreecommitdiffstats
path: root/include/uncompress.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-11-28 21:40:58 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-11-29 21:12:42 +0100
commiteb1c2e7de651b90f12864303ec965084d7206761 (patch)
tree36f511876f2eae55d269ee606e8b01bfe112639b /include/uncompress.h
parent83d0904980531a4ac96ebc1f5becc52422536dbe (diff)
downloadbarebox-eb1c2e7de651b90f12864303ec965084d7206761.tar.gz
barebox-eb1c2e7de651b90f12864303ec965084d7206761.tar.xz
Add generic uncompress function
uncompress() has the same prototype as the various kernel decompress functions. It automatically detects the compression type and selects the correct uncompress function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/uncompress.h')
-rw-r--r--include/uncompress.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/uncompress.h b/include/uncompress.h
new file mode 100644
index 0000000000..d146c90768
--- /dev/null
+++ b/include/uncompress.h
@@ -0,0 +1,19 @@
+#ifndef __UNCOMPRESS_H
+#define __UNCOMPRESS_H
+
+int uncompress(unsigned char *inbuf, int len,
+ int(*fill)(void*, unsigned int),
+ int(*flush)(void*, unsigned int),
+ unsigned char *output,
+ int *pos,
+ void(*error_fn)(char *x));
+
+int uncompress_fd_to_fd(int infd, int outfd,
+ void(*error_fn)(char *x));
+
+int uncompress_fd_to_buf(int infd, void *output,
+ void(*error_fn)(char *x));
+
+void uncompress_err_stdout(char *);
+
+#endif /* __UNCOMPRESS_H */