]>
Commit | Line | Data |
---|---|---|
221cc3ce MT |
1 | /*############################################################################# |
2 | # # | |
3 | # Pakfire - The IPFire package management system # | |
4 | # Copyright (C) 2014 Pakfire development team # | |
5 | # # | |
6 | # This program is free software: you can redistribute it and/or modify # | |
7 | # it under the terms of the GNU General Public License as published by # | |
8 | # the Free Software Foundation, either version 3 of the License, or # | |
9 | # (at your option) any later version. # | |
10 | # # | |
11 | # This program is distributed in the hope that it will be useful, # | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
14 | # GNU General Public License for more details. # | |
15 | # # | |
16 | # You should have received a copy of the GNU General Public License # | |
17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
18 | # # | |
19 | #############################################################################*/ | |
20 | ||
21 | #ifndef PAKFIRE_ARCHIVE_H | |
22 | #define PAKFIRE_ARCHIVE_H | |
23 | ||
e1545ccb | 24 | #include <stddef.h> |
221cc3ce MT |
25 | |
26 | #include <pakfire/types.h> | |
27 | ||
618ca500 MT |
28 | typedef enum pakfire_archive_verify_status { |
29 | PAKFIRE_ARCHIVE_VERIFY_OK = 0, | |
30 | PAKFIRE_ARCHIVE_VERIFY_INVALID, | |
31 | PAKFIRE_ARCHIVE_VERIFY_SIG_EXPIRED, | |
32 | PAKFIRE_ARCHIVE_VERIFY_KEY_EXPIRED, | |
33 | PAKFIRE_ARCHIVE_VERIFY_KEY_UNKNOWN, | |
4efcd464 | 34 | PAKFIRE_ARCHIVE_VERIFY_ERROR, |
618ca500 MT |
35 | } pakfire_archive_verify_status_t; |
36 | ||
e1545ccb MT |
37 | typedef enum pakfire_archive_flags { |
38 | PAKFIRE_ARCHIVE_USE_PAYLOAD = 1 << 0, | |
39 | } pakfire_archive_flags_t; | |
40 | ||
618ca500 | 41 | PakfireArchive pakfire_archive_create(Pakfire pakfire); |
b7600b1d | 42 | PakfireArchive pakfire_archive_ref(PakfireArchive archive); |
75c60de7 | 43 | PakfireArchive pakfire_archive_unref(PakfireArchive archive); |
221cc3ce | 44 | |
618ca500 | 45 | PakfireArchive pakfire_archive_open(Pakfire pakfire, const char* path); |
221cc3ce MT |
46 | |
47 | int pakfire_archive_read(PakfireArchive archive, const char* filename, | |
48 | void** data, size_t* data_size, int flags); | |
49 | int pakfire_archive_extract(PakfireArchive archive, const char* prefix, int flags); | |
50 | ||
51 | const char* pakfire_archive_get_path(PakfireArchive archive); | |
52 | ||
53 | unsigned int pakfire_archive_get_format(PakfireArchive archive); | |
54 | ||
55 | PakfireFile pakfire_archive_get_filelist(PakfireArchive archive); | |
56 | ||
618ca500 MT |
57 | pakfire_archive_verify_status_t pakfire_archive_verify(PakfireArchive archive); |
58 | const char* pakfire_archive_verify_strerror(pakfire_archive_verify_status_t status); | |
59 | ||
b7600b1d MT |
60 | size_t pakfire_archive_count_signatures(PakfireArchive archive); |
61 | PakfireArchiveSignature* pakfire_archive_get_signatures(PakfireArchive archive); | |
62 | ||
63 | PakfireArchiveSignature pakfire_archive_signature_ref(PakfireArchiveSignature signature); | |
64 | void pakfire_archive_signature_unref(PakfireArchiveSignature signature); | |
65 | const char* pakfire_archive_signature_get_data(PakfireArchiveSignature signature); | |
66 | ||
6afc1aa6 | 67 | #define PAKFIRE_ARCHIVE_FN_CHECKSUMS "chksums" |
221cc3ce MT |
68 | #define PAKFIRE_ARCHIVE_FN_FILELIST "filelist" |
69 | #define PAKFIRE_ARCHIVE_FN_FORMAT "pakfire-format" | |
70 | #define PAKFIRE_ARCHIVE_FN_METADATA "info" | |
71 | #define PAKFIRE_ARCHIVE_FN_PAYLOAD "data.img" | |
618ca500 | 72 | #define PAKFIRE_ARCHIVE_FN_SIGNATURES "signatures" |
221cc3ce MT |
73 | |
74 | #ifdef PAKFIRE_PRIVATE | |
75 | ||
6afc1aa6 MT |
76 | typedef enum archive_checksum_algo { |
77 | PAKFIRE_CHECKSUM_UNKNOWN = 0, | |
78 | PAKFIRE_CHECKSUM_SHA512, | |
79 | } archive_checksum_algo_t; | |
80 | ||
221cc3ce MT |
81 | #endif |
82 | ||
83 | #endif /* PAKFIRE_ARCHIVE_H */ |