Merge branch 'i18n' of https://github.com/ignatenkobrain/claws
[claws.git] / src / plugins / archive / libarchive_archive.h
1 /* vim: set textwidth=80 tabstop=4: */
2
3 /*
4  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
5  * Copyright (C) 1999-2008 Michael Rasmussen and the Claws Mail Team
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  * 
20  */
21
22 #ifndef __LIBARCHIVE_ARCHIVE_H__
23 #define __LIBARCHIVE_ARCHIVE_H__
24
25 #include <glib.h>
26 #include "folder.h"
27
28 typedef enum _COMPRESS_METHOD COMPRESS_METHOD;
29 enum _COMPRESS_METHOD {
30                 ZIP,
31                 BZIP2,
32 #if NEW_ARCHIVE_API
33                 COMPRESS,
34 #endif
35                 NO_COMPRESS
36 };
37
38 typedef enum _ARCHIVE_FORMAT ARCHIVE_FORMAT;
39 enum _ARCHIVE_FORMAT {
40                 NO_FORMAT,
41                 TAR,
42                 SHAR,
43                 PAX,
44                 CPIO
45 };
46
47 enum FILE_FLAGS { NO_FLAGS, ARCHIVE_EXTRACT_PERM, ARCHIVE_EXTRACT_TIME,
48                                 ARCHIVE_EXTRACT_ACL, ARCHIVE_EXTRACT_FFLAGS };
49
50 typedef struct _MsgTrash MsgTrash;
51 struct _MsgTrash {
52     FolderItem* item;
53     /* List of MsgInfos* */
54     GSList* msgs;
55 };
56
57
58 MsgTrash* new_msg_trash(FolderItem* item);
59 void archive_free_archived_files();
60 void archive_add_msg_mark(MsgTrash* trash, MsgInfo* msg);
61 void archive_add_file(gchar* path);
62 GSList* archive_get_file_list();
63 void archive_free_file_list(gboolean md5, gboolean rename);
64 const gchar* archive_create(const char* archive_name, GSList* files,
65                                 COMPRESS_METHOD method, ARCHIVE_FORMAT format);
66 gboolean before_date(time_t msg_mtime, const gchar* before);
67
68 #ifdef _TEST
69 void archive_set_permissions(int perm);
70 const gchar* archive_extract(const char* archive_name, int flags);
71 void archive_scan_folder(const char* dir);
72 #endif
73
74 #endif
75