Permalink
Browse files

giant clusterfuck commit: *add and use alloca/strdupa in some spots *…

…implement return values on almost every function *free() is now a macro which also nulls the freed pointer *when in 'library mode', fatal_exit() will not be called *fatal()/failure() are now macros which add line number and file for logging *all occurrences of fatal/failure in files other than main.c are now wrapped to use a logging callback (if specified) and then return *functions now clean up resources on returning with an error
  • Loading branch information...
1 parent d7495ce commit 6dd20d735b8b56dabbe9c6fc5f66b2557c5eb140 discomfitor committed with Aug 12, 2011
Showing with 808 additions and 494 deletions.
  1. +29 −0 liblrzip.h
  2. +193 −152 lrzip.c
  3. +13 −13 lrzip.h
  4. +32 −0 lrzip_private.h
  5. +21 −21 main.c
  6. +86 −51 runzip.c
  7. +171 −81 rzip.c
  8. +1 −1 rzip.h
  9. +169 −99 stream.c
  10. +5 −5 stream.h
  11. +27 −62 util.c
  12. +61 −9 util.h
View
@@ -20,4 +20,33 @@
#ifndef LIBLRZIP_H
#define LIBLRZIP_H
+#include <stdbool.h>
+
+typedef struct Lrzip Lrzip;
+
+typedef enum {
+ LRZIP_MODE_NONE,
+ LRZIP_MODE_DECOMPRESS,
+ LRZIP_MODE_NO_COMPRESS,
+ LRZIP_MODE_LZO_COMPRESS,
+ LRZIP_MODE_BZIP2_COMPRESS,
+ LRZIP_MODE_ZLIB_COMPRESS,
+ LRZIP_MODE_ZPAQ_COMPRESS
+} Lrzip_Mode;
+
+typedef void (*Lrzip_Password_Cb)(void *, char **, size_t);
+
+bool lrzip_init(void);
+void lrzip_config_env(Lrzip *lr);
+void lrzip_free(Lrzip *lr);
+Lrzip *lrzip_new(Lrzip_Mode mode);
+Lrzip_Mode lrzip_mode_get(Lrzip *lr);
+char **lrzip_files_get(Lrzip *lr);
+bool lrzip_file_add(Lrzip *lr, const char *file);
+bool lrzip_file_del(Lrzip *lr, const char *file);
+void lrzip_outfile_set(Lrzip *lr, const char *file);
+const char *lrzip_outfile_get(Lrzip *lr);
+bool lrzip_run(Lrzip *lr);
+
#endif
+
Oops, something went wrong.

0 comments on commit 6dd20d7

Please sign in to comment.