Archiver plugin update and review:
authorwwp <wwp@free.fr>
Tue, 3 Jan 2017 18:14:10 +0000 (19:14 +0100)
committerwwp <wwp@free.fr>
Tue, 3 Jan 2017 18:14:10 +0000 (19:14 +0100)
- updated to support some of the compression formats up to libarchive 3.2.2,
- detect libarchive 2.8+ using pkgconfig,
- use alertpanel API instead of creating gtk dialogs from scratch (with missing
- dialog title, and no clue about what is displayed),
- configure script now makes use of libarchive pkgconfig,
- fixed wrong use of cached page struct info, we do now rely on data set in widgets
  to get source folder and target archive filename and sync the page struct info w/ it
  when needed,
- renamed gzip/zip to gzip,
- reworked the way archive formats and compression formats lists are displayed (not translatable anymore).
- reformat code a bit.

configure.ac
src/plugins/archive/Makefile.am
src/plugins/archive/archiver.c
src/plugins/archive/archiver_gtk.c
src/plugins/archive/archiver_prefs.c
src/plugins/archive/archiver_prefs.h
src/plugins/archive/libarchive_archive.c
src/plugins/archive/libarchive_archive.h

index 0042734..5677da4 100644 (file)
@@ -1141,10 +1141,13 @@ AC_SUBST(LIBSOUP_GNOME_CFLAGS)
 AC_SUBST(LIBSOUP_GNOME_LIBS)
 
 dnl libarchive *****************************************************************
+PKG_CHECK_MODULES(LIBARCHIVE, libarchive, HAVE_ARCHIVE=yes, HAVE_ARCHIVE=no)
+AC_SUBST(ARCHIVE_LIBS)
+AC_SUBST(ARCHIVE_CFLAGS)
 AC_CHECK_LIB([archive], [archive_read_new],
                       ARCHIVE_LIBS=-larchive
                       HAVE_ARCHIVE=yes
-                      AC_SUBST(ARCHIVE_LIBS),
+                      AC_SUBST(ARCHIVE_LIBS,ARCHIVE_CFLAGS),
                       HAVE_ARCHIVE=no
                       )
 
index 6b82192..0b7c9d3 100644 (file)
@@ -24,7 +24,8 @@ archiveinclude_HEADERS = \
 
 archive_la_LDFLAGS = \
                -avoid-version -module \
-               $(GTK_LIBS)
+               $(GTK_LIBS) \
+               $(LIBARCHIVE_LIBS)
 
 archive_la_LIBADD = \
                @ARCHIVE_LIBS@
@@ -36,4 +37,5 @@ archive_la_CPPFLAGS = \
        -I$(top_builddir)/src/common \
        -I$(top_srcdir)/src/gtk \
        $(GLIB_CFLAGS) \
-       $(GTK_CFLAGS)
+       $(GTK_CFLAGS) \
+       $(LIBARCHIVE_CFLAGS)
index 9d0c89e..65d22c7 100644 (file)
@@ -40,6 +40,8 @@
 #include "archiver_prefs.h"
 #include "menu.h"
 
+#include <archive.h>
+
 #define PLUGIN_NAME (_("Mail Archiver"))
 
 static void create_archive_cb(GtkAction *action, gpointer data) {
@@ -115,10 +117,9 @@ const gchar* plugin_name(void) {
        return PLUGIN_NAME;
 }
 
-#define ARCHIVER_COMPRESS_FORMATS "\tGZIP/ZIP\n\tBZIP2\n\tCOMPRESS\n"
-
 const gchar* plugin_desc(void) {
        if (plugin_description == NULL) {
+
                plugin_description = g_strdup_printf(_("This plugin adds archiving features to Claws Mail.\n"
                        "\n"
                        "It enables you to select a mail folder that you want "
@@ -127,8 +128,7 @@ const gchar* plugin_desc(void) {
                        "and MD5 checksums can be added for each file in the "
                        "archive. Several archiving options are also available.\n"
                        "\n"
-                       "The archive can be stored as:\n"
-                       "\tTAR\n\tPAX\n\tSHAR\n\tCPIO\n"
+                       "The archive can be stored as:\n%s"
                        "\n"
                        "The archive can be compressed using:\n%s"
                        "\n"
@@ -141,8 +141,26 @@ const gchar* plugin_desc(void) {
                        "To activate the archiving feature go to /Tools/Create Archive\n"
                        "\n"
                        "Default options can be set in /Configuration/Preferences/Plugins"
-                       "/Mail Archiver"
-                       ), ARCHIVER_COMPRESS_FORMATS);
+                       "/Mail Archiver"),
+
+/* archive formats (untranslated, libarchive-version dependant) */
+                       "\tTAR\n\tPAX\n\tSHAR\n\tCPIO\n",
+
+/* compression formats (untranslated, libarchive-version dependant) */
+                       "\tGZIP\n\tBZIP2\n\tCOMPRESS\n"
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+                       "\tLZMA\n\tXZ\n"
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+                       "\tLZIP\n"
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+                       "\tLRZIP\n\tLZOP\n\tGRZIP\n"
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+                       "\tLZ4\n"
+#endif
+                       );
        }
        return plugin_description;
 }
index 1fc0910..fdc5c92 100644 (file)
@@ -50,6 +50,9 @@
 #include "libarchive_archive.h"
 #include "archiver.h"
 #include "archiver_prefs.h"
+#include "alertpanel.h"
+
+#include <archive.h>
 
 typedef struct _progress_widget progress_widget;
 struct _progress_widget {
@@ -195,23 +198,6 @@ static void dispose_archive_page(struct ArchivePage* page) {
        g_free(page);
 }
 
-static gboolean uncommitted_entry_info(struct ArchivePage* page) {
-       const gchar* path = gtk_entry_get_text(GTK_ENTRY(page->folder));
-       const gchar* name = gtk_entry_get_text(GTK_ENTRY(page->file));
-       
-       if (! page->path && *path != '\0') {
-               debug_print("page->path: (NULL) -> %s\n", path);
-               page->path = g_strdup(path);
-       }
-       if (! page->name && *name != '\0') {
-               page->force_overwrite = FALSE;
-               debug_print("page->file: (NULL) -> %s\n", name);
-               page->name = g_strdup(name);
-       }
-       
-       return (page->path && page->name) ? TRUE : FALSE;
-}
-
 static gboolean valid_file_name(gchar* file) {
        int i;
 
@@ -228,9 +214,9 @@ static COMPRESS_METHOD get_compress_method(GSList* btn) {
        while (btn) {
                if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(btn->data))) {
                        name = gtk_widget_get_name(GTK_WIDGET(btn->data));
-                       if (strcmp("ZIP", name) == 0) {
-                               debug_print("ZIP compression enabled\n");
-                               return ZIP;
+                       if (strcmp("GZIP", name) == 0) {
+                               debug_print("GZIP compression enabled\n");
+                               return GZIP;
                        }
                        else if (strcmp("BZIP", name) == 0) {
                                debug_print("BZIP2 compression enabled\n");
@@ -240,6 +226,42 @@ static COMPRESS_METHOD get_compress_method(GSList* btn) {
                                debug_print("COMPRESS compression enabled\n");
                                return COMPRESS;
                        }
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+                       else if (strcmp("LZMA", name) == 0) {
+                               debug_print("LZMA compression enabled\n");
+                               return LZMA;
+                       }
+                       else if (strcmp("XZ", name) == 0) {
+                               debug_print("XZ compression enabled\n");
+                               return XZ;
+                       }
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+                       else if (strcmp("LZIP", name) == 0) {
+                               debug_print("LZIP compression enabled\n");
+                               return LZIP;
+                       }
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+                       else if (strcmp("LRZIP", name) == 0) {
+                               debug_print("LRZIP compression enabled\n");
+                               return LRZIP;
+                       }
+                       else if (strcmp("LZOP", name) == 0) {
+                               debug_print("LZOP compression enabled\n");
+                               return LZOP;
+                       }
+                       else if (strcmp("GRZIP", name) == 0) {
+                               debug_print("GRZIP compression enabled\n");
+                               return GRZIP;
+                       }
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+                       else if (strcmp("LZ4", name) == 0) {
+                               debug_print("LZ4 compression enabled\n");
+                               return LZ4;
+                       }
+#endif
                        else if (strcmp("NONE", name) == 0) {
                                debug_print("Compression disabled\n");
                                return NO_COMPRESS;
@@ -483,102 +505,88 @@ static AFileTest file_is_writeable(struct ArchivePage* page) {
 }
 
 static gboolean archiver_save_files(struct ArchivePage* page) {
-       GtkWidget* dialog;
-       MainWindow* mainwin = mainwindow_get_mainwindow();
        FolderItem* item;
        COMPRESS_METHOD method;
        ARCHIVE_FORMAT format;
        gboolean recursive;
-       int response;
        guint orig_file;
        GSList* list = NULL;
        const gchar* res = NULL;
-        AFileTest perm;
-        gchar* msg = NULL;
+       AFileTest perm;
+       gchar* msg = NULL;
+       gboolean folder_not_set;
+       gboolean file_not_set;
+
+       /* check if folder to archive and target archive filename are set */
+       folder_not_set = (*gtk_entry_get_text(GTK_ENTRY(page->folder)) == '\0');
+       file_not_set = (*gtk_entry_get_text(GTK_ENTRY(page->file)) == '\0');
+       if (folder_not_set || file_not_set) {
+               alertpanel_error(_("Some uninitialized data prevents from starting\n"
+                                       "the archiving process:\n"
+                                       "%s%s"),
+                       folder_not_set ? _("\n- the folder to archive is not set") : "",
+                       file_not_set ? _("\n- the name for archive is not set") : "");
+               return FALSE;
+       }
+       /* sync page struct info with folder and archive name edit widgets */
+       if (page->path) {
+               g_free(page->path);
+               page->path = NULL;
+       }
+       page->path = g_strdup(gtk_entry_get_text(GTK_ENTRY(page->folder)));
+       g_strstrip(page->path);
+       debug_print("page->path: %s\n", page->path);
 
-       if (page->path == NULL || page->name == NULL) {
-               /* Test if page->file and page->folder has uncommitted information */
-               if (! uncommitted_entry_info(page)) {
-                       dialog = gtk_message_dialog_new(
-                               GTK_WINDOW(mainwin->window),
-                               GTK_DIALOG_DESTROY_WITH_PARENT,
-                               GTK_MESSAGE_ERROR,
-                               GTK_BUTTONS_CLOSE,
-                               _("Folder and archive must be selected"));
-                       gtk_dialog_run (GTK_DIALOG (dialog));
-                       gtk_widget_destroy (dialog);
-                       return FALSE;
-               }
+       if (page->name) {
+               g_free(page->name);
+               page->name = NULL;
        }
+       page->name = g_strdup(gtk_entry_get_text(GTK_ENTRY(page->file)));
+       g_strstrip(page->name);
+       debug_print("page->name: %s\n", page->name);
+
        if ((perm = file_is_writeable(page)) != A_FILE_OK) {
-            switch (perm) {
-                case A_FILE_EXISTS:
-                    msg = g_strdup_printf(_("%s: Exists. Continue anyway?"), page->name);
-                    break;
-                case A_FILE_IS_LINK:
-                    msg = g_strdup_printf(_("%s: Is a link. Cannot continue"), page->name);
-                    break;
-                 case A_FILE_IS_DIR:
-                     msg = g_strdup_printf(_("%s: Is a directory. Cannot continue"), page->name);
-                    break;
-                case A_FILE_NO_WRITE:
-                     msg = g_strdup_printf(_("%s: Missing permissions. Cannot continue"), page->name);
-                    break;
-                case A_FILE_UNKNOWN:
-                    msg = g_strdup_printf(_("%s: Unknown error. Cannot continue"), page->name);
-                    break;
-                default: break;
-            }
-            if (perm == A_FILE_EXISTS) {
-               dialog = gtk_message_dialog_new(
-                       GTK_WINDOW(mainwin->window),
-                       GTK_DIALOG_DESTROY_WITH_PARENT,
-                       GTK_MESSAGE_WARNING,
-                       GTK_BUTTONS_OK_CANCEL,
-                       "%s", msg);
-               response = gtk_dialog_run(GTK_DIALOG (dialog));
-               gtk_widget_destroy(dialog);
-                g_free(msg);
-               if (response == GTK_RESPONSE_CANCEL) {
+               switch (perm) {
+                       case A_FILE_EXISTS:
+                               msg = g_strdup_printf(_("%s: Exists. Continue anyway?"), page->name);
+                               break;
+                       case A_FILE_IS_LINK:
+                               msg = g_strdup_printf(_("%s: Is a link. Cannot continue"), page->name);
+                               break;
+                        case A_FILE_IS_DIR:
+                                msg = g_strdup_printf(_("%s: Is a directory. Cannot continue"), page->name);
+                               break;
+                       case A_FILE_NO_WRITE:
+                                msg = g_strdup_printf(_("%s: Missing permissions. Cannot continue"), page->name);
+                               break;
+                       case A_FILE_UNKNOWN:
+                               msg = g_strdup_printf(_("%s: Unknown error. Cannot continue"), page->name);
+                               break;
+                       default:
+                               break;
+               }
+               if (perm == A_FILE_EXISTS) {
+                       AlertValue aval;
+
+                       aval = alertpanel_full(_("Creating archive"), msg,
+                               GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, FALSE,
+                               NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                       g_free(msg);
+                       if (aval != G_ALERTALTERNATE)
+                               return FALSE;
+               } else {
+                       alertpanel_error(msg);
+                       g_free(msg);
                        return FALSE;
                }
-            }
-            else {
-               dialog = gtk_message_dialog_new(
-                       GTK_WINDOW(mainwin->window),
-                       GTK_DIALOG_DESTROY_WITH_PARENT,
-                       GTK_MESSAGE_ERROR,
-                       GTK_BUTTONS_OK,
-                       "%s", msg);
-               response = gtk_dialog_run(GTK_DIALOG (dialog));
-               gtk_widget_destroy(dialog);
-                g_free(msg);
-               return FALSE;
-            }
        }
        if (! valid_file_name(page->name)) {
-               dialog = gtk_message_dialog_new(
-                       GTK_WINDOW(mainwin->window),
-                       GTK_DIALOG_DESTROY_WITH_PARENT,
-                       GTK_MESSAGE_ERROR,
-                       GTK_BUTTONS_CLOSE,
-                       _("Not a valid file name:\n%s."),
-                       page->name);
-               gtk_dialog_run (GTK_DIALOG (dialog));
-               gtk_widget_destroy (dialog);
+               alertpanel_error(_("Not a valid file name:\n%s."), page->name);
                return FALSE;
        }
        item = folder_find_item_from_identifier(page->path);
        if (! item) {
-               dialog = gtk_message_dialog_new(
-                       GTK_WINDOW(mainwin->window),
-                       GTK_DIALOG_DESTROY_WITH_PARENT,
-                       GTK_MESSAGE_ERROR,
-                       GTK_BUTTONS_CLOSE,
-                       _("Not a valid Claws Mail folder:\n%s."),
-                       page->path);
-               gtk_dialog_run (GTK_DIALOG (dialog));
-               gtk_widget_destroy (dialog);
+               alertpanel_error(_("Not a valid Claws Mail folder:\n%s."), page->name);
                return FALSE;
        }
        page->files = 0;
@@ -599,19 +607,19 @@ static gboolean archiver_save_files(struct ArchivePage* page) {
        debug_print("md5: %d, orig: %d, md5: %d\n", 
                                        page->md5, page->files, orig_file);
        if (orig_file != g_slist_length(list)) {
-               dialog = gtk_message_dialog_new(
-                               GTK_WINDOW(mainwin->window),
-                               GTK_DIALOG_DESTROY_WITH_PARENT,
-                               GTK_MESSAGE_WARNING,
-                               GTK_BUTTONS_OK_CANCEL,
+               AlertValue aval;
+
+               msg = g_strdup_printf(
                                _("Adding files in folder failed\n"
                                  "Files in folder: %d\n"
                                  "Files in list:   %d\n"
                                  "\nContinue anyway?"),
                                orig_file, g_slist_length(list));
-               response = gtk_dialog_run(GTK_DIALOG (dialog));
-               gtk_widget_destroy(dialog);
-               if (response == GTK_RESPONSE_CANCEL) {
+               aval = alertpanel_full(_("Creating archive"), msg,
+                       GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, FALSE,
+                       NULL, ALERT_WARNING, G_ALERTDEFAULT);
+               g_free(msg);
+               if (aval != G_ALERTALTERNATE) {
                        archive_free_file_list(page->md5, page->rename);
                        return FALSE;
                }
@@ -619,20 +627,13 @@ static gboolean archiver_save_files(struct ArchivePage* page) {
        method = get_compress_method(page->compress_methods);
        format = get_archive_format(page->archive_formats);
        if ((res = archive_create(page->name, list, method, format)) != NULL) {
-               dialog = gtk_message_dialog_new(
-                       GTK_WINDOW(mainwin->window),
-                       GTK_DIALOG_DESTROY_WITH_PARENT,
-                       GTK_MESSAGE_ERROR,
-                       GTK_BUTTONS_CLOSE,
-                       "%s", res);
-               gtk_dialog_run (GTK_DIALOG (dialog));
-               gtk_widget_destroy (dialog);
+               alertpanel_error(_("Archive creation error:\n%s"), res);
                archive_free_file_list(page->md5, page->rename);
                return FALSE;
        }
-        if (page->unlink) {
-            archive_free_archived_files();
-        }
+       if (page->unlink) {
+               archive_free_archived_files();
+       }
        return TRUE;
 }
 
@@ -673,8 +674,8 @@ static void show_result(struct ArchivePage* page) {
        MainWindow* mainwin = mainwindow_get_mainwindow();
 
        switch (get_compress_method(page->compress_methods)) {
-               case ZIP:
-                       method = g_strdup("ZIP");
+               case GZIP:
+                       method = g_strdup("GZIP");
                        break;
                case BZIP2:
                        method = g_strdup("BZIP2");
@@ -682,6 +683,35 @@ static void show_result(struct ArchivePage* page) {
         case COMPRESS:
                        method = g_strdup("Compress");
                        break;
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+               case LZMA:
+                       method = g_strdup("LZMA");
+                       break;
+               case XZ:
+                       method = g_strdup("XZ");
+                       break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+               case LZIP:
+                       method = g_strdup("LZIP");
+                       break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+               case LRZIP:
+                       method = g_strdup("LRZIP");
+                       break;
+               case LZOP:
+                       method = g_strdup("LZOP");
+                       break;
+               case GRZIP:
+                       method = g_strdup("GRZIP");
+                       break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+               case LZ4:
+                       method = g_strdup("LZ4");
+                       break;
+#endif
                case NO_COMPRESS:
                        method = g_strdup("No Compression");
                        break;
@@ -968,9 +998,24 @@ void archiver_gtk_show() {
        GtkWidget* folder_select;
        GtkWidget* file_label;
        GtkWidget* file_select;
-       GtkWidget* zip_radio_btn;
+       GtkWidget* gzip_radio_btn;
        GtkWidget* bzip_radio_btn;
     GtkWidget* compress_radio_btn;
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       GtkWidget* lzma_radio_btn;
+       GtkWidget* xz_radio_btn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       GtkWidget* lzip_radio_btn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+       GtkWidget* lrzip_radio_btn;
+       GtkWidget* lzop_radio_btn;
+       GtkWidget* grzip_radio_btn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       GtkWidget* lz4_radio_btn;
+#endif
        GtkWidget* no_radio_btn;
        GtkWidget* shar_radio_btn;
        GtkWidget* pax_radio_btn;
@@ -1053,48 +1098,134 @@ void archiver_gtk_show() {
        gtk_container_set_border_width(GTK_CONTAINER(hbox1), 4);
        gtk_container_add(GTK_CONTAINER(frame), hbox1);
 
-       zip_radio_btn = gtk_radio_button_new_with_mnemonic(NULL, "_ZIP");
-       gtk_widget_set_name(zip_radio_btn, "ZIP");
-       gtk_box_pack_start(GTK_BOX(hbox1), zip_radio_btn, FALSE, FALSE, 0);
-       CLAWS_SET_TIP(zip_radio_btn,
-                       _("Choose this option to use ZIP compression for the archive"));
+       gzip_radio_btn = gtk_radio_button_new_with_mnemonic(NULL, "G_ZIP");
+       gtk_widget_set_name(gzip_radio_btn, "GZIP");
+       gtk_box_pack_start(GTK_BOX(hbox1), gzip_radio_btn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(gzip_radio_btn,
+                       _("Choose this option to use GZIP compression for the archive"));
 
        bzip_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
-                                       GTK_RADIO_BUTTON(zip_radio_btn), "BZIP_2");
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), "BZIP_2");
        gtk_widget_set_name(bzip_radio_btn, "BZIP");
        gtk_box_pack_start(GTK_BOX(hbox1), bzip_radio_btn, FALSE, FALSE, 0);
        CLAWS_SET_TIP(bzip_radio_btn,
                        _("Choose this option to use BZIP2 compression for the archive"));
 
        compress_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
-                                       GTK_RADIO_BUTTON(zip_radio_btn), "Com_press");
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), "Com_press");
        gtk_widget_set_name(compress_radio_btn, "COMPRESS");
        gtk_box_pack_start(GTK_BOX(hbox1), compress_radio_btn, FALSE, FALSE, 0);
        CLAWS_SET_TIP(compress_radio_btn,
                _("Choose this to use Compress compression for your archive"));
 
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       lzma_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), "_LZMA");
+       gtk_widget_set_name(lzma_radio_btn, "LZMA");
+       gtk_box_pack_start(GTK_BOX(hbox1), lzma_radio_btn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lzma_radio_btn,
+                       _("Choose this option to use LZMA compression for the archive"));
+
+       xz_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), "_XZ");
+       gtk_widget_set_name(xz_radio_btn, "XZ");
+       gtk_box_pack_start(GTK_BOX(hbox1), xz_radio_btn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(xz_radio_btn,
+                       _("Choose this option to use XZ compression for the archive"));
+#endif
+
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       lzip_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), "_LZIP");
+       gtk_widget_set_name(lzip_radio_btn, "LZIP");
+       gtk_box_pack_start(GTK_BOX(hbox1), lzip_radio_btn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lzip_radio_btn,
+                       _("Choose this option to use LZIP compression for the archive"));
+#endif
+
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       lrzip_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), "L_RZIP");
+       gtk_widget_set_name(lrzip_radio_btn, "LRZIP");
+       gtk_box_pack_start(GTK_BOX(hbox1), lrzip_radio_btn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lrzip_radio_btn,
+                       _("Choose this option to use LRZIP compression for the archive"));
+
+       lzop_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), "LZ_OP");
+       gtk_widget_set_name(lzop_radio_btn, "LZOP");
+       gtk_box_pack_start(GTK_BOX(hbox1), lzop_radio_btn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lzop_radio_btn,
+                       _("Choose this option to use LZOP compression for the archive"));
+
+       grzip_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), "_GRZIP");
+       gtk_widget_set_name(grzip_radio_btn, "GRZIP");
+       gtk_box_pack_start(GTK_BOX(hbox1), grzip_radio_btn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(grzip_radio_btn,
+                       _("Choose this option to use GRZIP compression for the archive"));
+#endif
+
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       lz4_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), "LZ_4");
+       gtk_widget_set_name(lz4_radio_btn, "LZ4");
+       gtk_box_pack_start(GTK_BOX(hbox1), lz4_radio_btn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lz4_radio_btn,
+                       _("Choose this option to use LZ4 compression for the archive"));
+#endif
+
        no_radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(
-                                       GTK_RADIO_BUTTON(zip_radio_btn), _("_None"));
+                                       GTK_RADIO_BUTTON(gzip_radio_btn), _("_None"));
        gtk_widget_set_name(no_radio_btn, "NONE");
        gtk_box_pack_start(GTK_BOX(hbox1), no_radio_btn, FALSE, FALSE, 0);
        CLAWS_SET_TIP(no_radio_btn,
                _("Choose this option to disable compression for the archive"));
 
        page->compress_methods = 
-                       gtk_radio_button_get_group(GTK_RADIO_BUTTON(zip_radio_btn));
+                       gtk_radio_button_get_group(GTK_RADIO_BUTTON(gzip_radio_btn));
 
        switch (archiver_prefs.compression) {
-       case COMPRESSION_ZIP:
-               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(zip_radio_btn), TRUE);
+       case COMPRESSION_GZIP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gzip_radio_btn), TRUE);
                break;
        case COMPRESSION_BZIP:
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bzip_radio_btn), TRUE);
                break;
-        case COMPRESSION_COMPRESS:
-            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compress_radio_btn), TRUE);
-                break;
-           case COMPRESSION_NONE:
-                   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(no_radio_btn), TRUE);
+       case COMPRESSION_COMPRESS:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compress_radio_btn), TRUE);
+               break;
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       case COMPRESSION_LZMA:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lzma_radio_btn), TRUE);
+               break;
+       case COMPRESSION_XZ:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(xz_radio_btn), TRUE);
+               break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       case COMPRESSION_LZIP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lzip_radio_btn), TRUE);
+               break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+       case COMPRESSION_LRZIP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lrzip_radio_btn), TRUE);
+               break;
+       case COMPRESSION_LZOP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lzop_radio_btn), TRUE);
+               break;
+       case COMPRESSION_GRZIP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(grzip_radio_btn), TRUE);
+               break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       case COMPRESSION_LZ4:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lz4_radio_btn), TRUE);
+               break;
+#endif
+       case COMPRESSION_NONE:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(no_radio_btn), TRUE);
                break;
        }
 
index 8770c89..fb733d5 100644 (file)
@@ -48,9 +48,24 @@ struct ArchiverPrefsPage {
         PrefsPage page;
         GtkWidget *save_folder;
        gint compression;
-       GtkWidget *zip_radiobtn;
+       GtkWidget *gzip_radiobtn;
        GtkWidget *bzip_radiobtn;
     GtkWidget *compress_radiobtn;
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       GtkWidget *lzma_radiobtn;
+       GtkWidget *xz_radiobtn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       GtkWidget *lzip_radiobtn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+       GtkWidget *lrzip_radiobtn;
+       GtkWidget *lzop_radiobtn;
+       GtkWidget *grzip_radiobtn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       GtkWidget *lz4_radiobtn;
+#endif
        GtkWidget *none_radiobtn;
        GtkWidget *tar_radiobtn;
        GtkWidget *shar_radiobtn;
@@ -157,9 +172,24 @@ static void create_archiver_prefs_page(PrefsPage * _page,
        GtkWidget *save_folder_select;
        GtkWidget *frame;
        GSList    *compression_group = NULL;
-       GtkWidget *zip_radiobtn;
+       GtkWidget *gzip_radiobtn;
        GtkWidget *bzip_radiobtn;
     GtkWidget *compress_radiobtn;
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       GtkWidget *lzma_radiobtn;
+       GtkWidget *xz_radiobtn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       GtkWidget *lzip_radiobtn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+       GtkWidget *lrzip_radiobtn;
+       GtkWidget *lzop_radiobtn;
+       GtkWidget *grzip_radiobtn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       GtkWidget *lz4_radiobtn;
+#endif
        GtkWidget *none_radiobtn;
        GSList    *format_group = NULL;
        GtkWidget *tar_radiobtn;
@@ -211,12 +241,12 @@ static void create_archiver_prefs_page(PrefsPage * _page,
        gtk_container_set_border_width(GTK_CONTAINER(hbox1), 4);
        gtk_container_add(GTK_CONTAINER(frame), hbox1);
 
-       zip_radiobtn = gtk_radio_button_new_with_label(compression_group, "ZIP");
-       compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(zip_radiobtn));
-       gtk_widget_show(zip_radiobtn);
-       gtk_box_pack_start(GTK_BOX (hbox1), zip_radiobtn, FALSE, FALSE, 0);
-       CLAWS_SET_TIP(zip_radiobtn,
-                       _("Choose this option to use ZIP compression by default"));
+       gzip_radiobtn = gtk_radio_button_new_with_label(compression_group, "GZIP");
+       compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(gzip_radiobtn));
+       gtk_widget_show(gzip_radiobtn);
+       gtk_box_pack_start(GTK_BOX (hbox1), gzip_radiobtn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(gzip_radiobtn,
+                       _("Choose this option to use GZIP compression by default"));
 
        bzip_radiobtn = gtk_radio_button_new_with_label(compression_group, "BZIP2");
        compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(bzip_radiobtn));
@@ -232,6 +262,63 @@ static void create_archiver_prefs_page(PrefsPage * _page,
        CLAWS_SET_TIP(compress_radiobtn,
                        _("Choose this option to use COMPRESS compression by default"));
 
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       lzma_radiobtn = gtk_radio_button_new_with_label(compression_group, "LZMA");
+       compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(lzma_radiobtn));
+       gtk_widget_show(lzma_radiobtn);
+       gtk_box_pack_start(GTK_BOX (hbox1), lzma_radiobtn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lzma_radiobtn,
+                       _("Choose this option to use LZMA compression by default"));
+
+       xz_radiobtn = gtk_radio_button_new_with_label(compression_group, "XZ");
+       compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(xz_radiobtn));
+       gtk_widget_show(xz_radiobtn);
+       gtk_box_pack_start(GTK_BOX (hbox1), xz_radiobtn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(xz_radiobtn,
+                       _("Choose this option to use XZ compression by default"));
+#endif
+
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       lzip_radiobtn = gtk_radio_button_new_with_label(compression_group, "LZIP");
+       compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(lzip_radiobtn));
+       gtk_widget_show(lzip_radiobtn);
+       gtk_box_pack_start(GTK_BOX (hbox1), lzip_radiobtn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lzip_radiobtn,
+                       _("Choose this option to use LZIP compression by default"));
+#endif
+
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+       lrzip_radiobtn = gtk_radio_button_new_with_label(compression_group, "LRZIP");
+       compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(lrzip_radiobtn));
+       gtk_widget_show(lrzip_radiobtn);
+       gtk_box_pack_start(GTK_BOX (hbox1), lrzip_radiobtn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lrzip_radiobtn,
+                       _("Choose this option to use LRZIP compression by default"));
+
+       lzop_radiobtn = gtk_radio_button_new_with_label(compression_group, "LZOP");
+       compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(lzop_radiobtn));
+       gtk_widget_show(lzop_radiobtn);
+       gtk_box_pack_start(GTK_BOX (hbox1), lzop_radiobtn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lzop_radiobtn,
+                       _("Choose this option to use LZOP compression by default"));
+
+       grzip_radiobtn = gtk_radio_button_new_with_label(compression_group, "GRZIP");
+       compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(grzip_radiobtn));
+       gtk_widget_show(grzip_radiobtn);
+       gtk_box_pack_start(GTK_BOX (hbox1), grzip_radiobtn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(grzip_radiobtn,
+                       _("Choose this option to use GRZIP compression by default"));
+#endif
+
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       lz4_radiobtn = gtk_radio_button_new_with_label(compression_group, "LZ4");
+       compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(lz4_radiobtn));
+       gtk_widget_show(lz4_radiobtn);
+       gtk_box_pack_start(GTK_BOX (hbox1), lz4_radiobtn, FALSE, FALSE, 0);
+       CLAWS_SET_TIP(lz4_radiobtn,
+                       _("Choose this option to use LZ4 compression by default"));
+#endif
+
     none_radiobtn = gtk_radio_button_new_with_label(compression_group, _("None"));
        compression_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(none_radiobtn));
        gtk_widget_show(none_radiobtn);
@@ -240,8 +327,8 @@ static void create_archiver_prefs_page(PrefsPage * _page,
                        _("Choose this option to disable compression by default"));
 
        switch (archiver_prefs.compression) {
-       case COMPRESSION_ZIP:
-               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(zip_radiobtn), TRUE);
+       case COMPRESSION_GZIP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gzip_radiobtn), TRUE);
                break;
        case COMPRESSION_BZIP:
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bzip_radiobtn), TRUE);
@@ -249,6 +336,35 @@ static void create_archiver_prefs_page(PrefsPage * _page,
     case COMPRESSION_COMPRESS:       
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compress_radiobtn), TRUE);
                break;
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       case COMPRESSION_LZMA:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lzma_radiobtn), TRUE);
+               break;
+       case COMPRESSION_XZ:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(xz_radiobtn), TRUE);
+               break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       case COMPRESSION_LZIP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lzip_radiobtn), TRUE);
+               break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+       case COMPRESSION_LRZIP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lrzip_radiobtn), TRUE);
+               break;
+       case COMPRESSION_LZOP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lzop_radiobtn), TRUE);
+               break;
+       case COMPRESSION_GRZIP:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(grzip_radiobtn), TRUE);
+               break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       case COMPRESSION_LZ4:
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lz4_radiobtn), TRUE);
+               break;
+#endif
        case COMPRESSION_NONE:
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(none_radiobtn), TRUE);
                break;
@@ -341,9 +457,24 @@ static void create_archiver_prefs_page(PrefsPage * _page,
 
 
        page->save_folder = save_folder;
-       page->zip_radiobtn = zip_radiobtn;
+       page->gzip_radiobtn = gzip_radiobtn;
        page->bzip_radiobtn = bzip_radiobtn;
     page->compress_radiobtn = compress_radiobtn;
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       page->lzma_radiobtn = lzma_radiobtn;
+       page->xz_radiobtn = xz_radiobtn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       page->lzip_radiobtn = lzip_radiobtn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+       page->lrzip_radiobtn = lrzip_radiobtn;
+       page->lzop_radiobtn = lzop_radiobtn;
+       page->grzip_radiobtn = grzip_radiobtn;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       page->lz4_radiobtn = lz4_radiobtn;
+#endif
        page->none_radiobtn = none_radiobtn;
        page->tar_radiobtn = tar_radiobtn;
        page->shar_radiobtn = shar_radiobtn;
@@ -370,12 +501,34 @@ static void save_archiver_prefs(PrefsPage * _page)
                                           COMMON_RC, NULL);
 
        archiver_prefs.save_folder = gtk_editable_get_chars(GTK_EDITABLE(page->save_folder), 0, -1);
-       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->zip_radiobtn)))
-               archiver_prefs.compression = COMPRESSION_ZIP;
+       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->gzip_radiobtn)))
+               archiver_prefs.compression = COMPRESSION_GZIP;
        else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->bzip_radiobtn)))
                archiver_prefs.compression = COMPRESSION_BZIP;
        else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->compress_radiobtn)))
                archiver_prefs.compression = COMPRESSION_COMPRESS;
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->lzma_radiobtn)))
+               archiver_prefs.compression = COMPRESSION_LZMA;
+       else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->xz_radiobtn)))
+               archiver_prefs.compression = COMPRESSION_XZ;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->lzip_radiobtn)))
+               archiver_prefs.compression = COMPRESSION_LZIP;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+       else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->lrzip_radiobtn)))
+               archiver_prefs.compression = COMPRESSION_LRZIP;
+       else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->lzop_radiobtn)))
+               archiver_prefs.compression = COMPRESSION_LZOP;
+       else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->grzip_radiobtn)))
+               archiver_prefs.compression = COMPRESSION_GRZIP;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->lz4_radiobtn)))
+               archiver_prefs.compression = COMPRESSION_LZ4;
+#endif
        else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->none_radiobtn)))
                archiver_prefs.compression = COMPRESSION_NONE;
 
index d5ec94a..0e9572e 100644 (file)
 #define __ARCHIVERPREFS__
 
 #include <glib.h>
+#include <archive.h>
 
 typedef struct _ArchiverPrefs  ArchiverPrefs;
 
 typedef enum {
-       COMPRESSION_ZIP,
+       COMPRESSION_GZIP,
        COMPRESSION_BZIP,
     COMPRESSION_COMPRESS,
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+       COMPRESSION_LZMA,
+       COMPRESSION_XZ,
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+       COMPRESSION_LZIP,
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+       COMPRESSION_LRZIP,
+       COMPRESSION_LZOP,
+       COMPRESSION_GRZIP,
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+       COMPRESSION_LZ4,
+#endif
     COMPRESSION_NONE
 } CompressionType;
 
index 018108b..7aa9595 100644 (file)
@@ -460,7 +460,7 @@ const gchar* archive_create(const char* archive_name, GSList* files,
        debug_print("File: %s\n", archive_name);
        arch = archive_write_new();
        switch (method) {
-               case ZIP:
+               case GZIP:
 #if ARCHIVE_VERSION_NUMBER < 3000000
                        if (archive_write_set_compression_gzip(arch) != ARCHIVE_OK)
 #else
@@ -484,6 +484,50 @@ const gchar* archive_create(const char* archive_name, GSList* files,
 #endif
                                return archive_error_string(arch);
                        break;
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+               case LZMA:
+#if ARCHIVE_VERSION_NUMBER < 3000000
+                       if (archive_write_set_compression_lzma(arch) != ARCHIVE_OK)
+#else
+                       if (archive_write_add_filter_lzma(arch) != ARCHIVE_OK)
+#endif
+                               return archive_error_string(arch);
+                       break;
+               case XZ:
+#if ARCHIVE_VERSION_NUMBER < 3000000
+                       if (archive_write_set_compression_xz(arch) != ARCHIVE_OK)
+#else
+                       if (archive_write_add_filter_xz(arch) != ARCHIVE_OK)
+#endif
+                               return archive_error_string(arch);
+                       break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+               case LZIP:
+                       if (archive_write_add_filter_lzip(arch) != ARCHIVE_OK)
+                               return archive_error_string(arch);
+                       break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+               case LRZIP:
+                       if (archive_write_add_filter_lrzip(arch) != ARCHIVE_OK)
+                               return archive_error_string(arch);
+                       break;
+               case LZOP:
+                       if (archive_write_add_filter_lzop(arch) != ARCHIVE_OK)
+                               return archive_error_string(arch);
+                       break;
+               case GRZIP:
+                       if (archive_write_add_filter_grzip(arch) != ARCHIVE_OK)
+                               return archive_error_string(arch);
+                       break;
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+               case LZ4:
+                       if (archive_write_add_filter_lz4(arch) != ARCHIVE_OK)
+                               return archive_error_string(arch);
+                       break;
+#endif
                case NO_COMPRESS:
 #if ARCHIVE_VERSION_NUMBER < 3000000
                        if (archive_write_set_compression_none(arch) != ARCHIVE_OK)
index f33e4ad..1659cc6 100644 (file)
 #include <glib.h>
 #include "folder.h"
 
+#include <archive.h>
+
 typedef enum _COMPRESS_METHOD COMPRESS_METHOD;
 enum _COMPRESS_METHOD {
-               ZIP,
+               GZIP,
                BZIP2,
         COMPRESS,
+#if ARCHIVE_VERSION_NUMBER >= 2006990
+               LZMA,
+               XZ,
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+               LZIP,
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001000
+               LRZIP,
+               LZOP,
+               GRZIP,
+#endif
+#if ARCHIVE_VERSION_NUMBER >= 3001900
+               LZ4,
+#endif
         NO_COMPRESS
 };
 
@@ -42,9 +59,6 @@ enum _ARCHIVE_FORMAT {
                CPIO
 };
 
-enum FILE_FLAGS { NO_FLAGS, ARCHIVE_EXTRACT_PERM, ARCHIVE_EXTRACT_TIME,
-                               ARCHIVE_EXTRACT_ACL, ARCHIVE_EXTRACT_FFLAGS };
-
 typedef struct _MsgTrash MsgTrash;
 struct _MsgTrash {
     FolderItem* item;
@@ -52,7 +66,6 @@ struct _MsgTrash {
     GSList* msgs;
 };
 
-
 MsgTrash* new_msg_trash(FolderItem* item);
 void archive_free_archived_files();
 void archive_add_msg_mark(MsgTrash* trash, MsgInfo* msg);
@@ -70,4 +83,3 @@ void archive_scan_folder(const char* dir);
 #endif
 
 #endif
-