]>
Commit | Line | Data |
---|---|---|
6e46b18e MT |
1 | /*############################################################################# |
2 | # # | |
3 | # Pakfire - The IPFire package management system # | |
4 | # Copyright (C) 2017 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_PAKFIRE_H | |
22 | #define PAKFIRE_PAKFIRE_H | |
23 | ||
b36355f7 | 24 | #include <stddef.h> |
8301098b | 25 | #include <stdio.h> |
3a5d37c5 | 26 | #include <sys/stat.h> |
8301098b | 27 | #include <time.h> |
b36355f7 | 28 | |
e4cfcbaa | 29 | #include <pakfire/parser.h> |
78cc8800 | 30 | #include <pakfire/repolist.h> |
6e46b18e MT |
31 | #include <pakfire/types.h> |
32 | ||
99fad89d MT |
33 | int pakfire_create(Pakfire* pakfire, const char* path, const char* arch, |
34 | const char* conf, int flags); | |
6e46b18e MT |
35 | |
36 | Pakfire pakfire_ref(Pakfire pakfire); | |
8c916a4d | 37 | Pakfire pakfire_unref(Pakfire pakfire); |
6e46b18e MT |
38 | |
39 | const char* pakfire_get_path(Pakfire pakfire); | |
097b6ca6 | 40 | |
510a90f4 MT |
41 | #define pakfire_make_cache_path(pakfire, path, format, ...) \ |
42 | __pakfire_make_cache_path(pakfire, path, sizeof(path) - 1, format, __VA_ARGS__) | |
43 | ||
44 | int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length, | |
45 | const char* format, ...) __attribute__((format(printf, 4, 5))); | |
46 | ||
69e754ab | 47 | int pakfire_bind(Pakfire pakfire, const char* src, const char* dst, int flags); |
6ef698ea | 48 | |
78f7a47c MT |
49 | int pakfire_copy_in(Pakfire pakfire, const char* src, const char* dst); |
50 | int pakfire_copy_out(Pakfire pakfire, const char* src, const char* dst); | |
51 | ||
6e46b18e MT |
52 | const char* pakfire_get_arch(Pakfire pakfire); |
53 | ||
72caad76 MT |
54 | int pakfire_get_offline(Pakfire pakfire); |
55 | void pakfire_set_offline(Pakfire pakfire, int offline); | |
56 | ||
86671603 MT |
57 | const char** pakfire_get_installonly(Pakfire pakfire); |
58 | void pakfire_set_installonly(Pakfire pakfire, const char** installonly); | |
59 | ||
f989dacd MT |
60 | int pakfire_version_compare(Pakfire pakfire, const char* evr1, const char* evr2); |
61 | ||
b36355f7 MT |
62 | size_t pakfire_count_packages(Pakfire pakfire); |
63 | ||
78cc8800 | 64 | struct pakfire_repolist* pakfire_get_repos(Pakfire pakfire); |
0560505f | 65 | PakfireRepo pakfire_get_repo(Pakfire pakfire, const char* name); |
843fcc66 | 66 | PakfireRepo pakfire_get_installed_repo(Pakfire pakfire); |
843fcc66 | 67 | |
f989dacd MT |
68 | PakfirePackageList pakfire_whatprovides(Pakfire pakfire, const char* provides, int flags); |
69 | PakfirePackageList pakfire_search(Pakfire pakfire, const char* what, int flags); | |
70 | ||
8301098b | 71 | int pakfire_cache_destroy(Pakfire pakfire, const char* path); |
3a5d37c5 | 72 | |
12656820 MT |
73 | // Logging |
74 | ||
bfa112c3 MT |
75 | void pakfire_log(Pakfire pakfire, int priority, const char *file, |
76 | int line, const char *fn, const char *format, ...) | |
77 | __attribute__((format(printf, 6, 7))); | |
78 | ||
12656820 MT |
79 | pakfire_log_function_t pakfire_log_get_function(Pakfire pakfire); |
80 | void pakfire_log_set_function(Pakfire pakfire, pakfire_log_function_t log_function); | |
81 | int pakfire_log_get_priority(Pakfire pakfire); | |
82 | void pakfire_log_set_priority(Pakfire pakfire, int priority); | |
83 | ||
e4cfcbaa MT |
84 | // Build |
85 | ||
86 | int pakfire_read_makefile(PakfireParser* parser, Pakfire pakfire, const char* path, | |
87 | struct pakfire_parser_error** error); | |
88 | ||
19f3d106 MT |
89 | #ifdef PAKFIRE_PRIVATE |
90 | ||
91 | #include <solv/pool.h> | |
92 | ||
59106773 MT |
93 | #include <pakfire/config.h> |
94 | ||
95 | struct pakfire_config* pakfire_get_config(Pakfire pakfire); | |
457db621 | 96 | int pakfire_is_mountpoint(Pakfire pakfire, const char* path); |
59106773 | 97 | |
59ab223d MT |
98 | const char* pakfire_get_distro_name(Pakfire pakfire); |
99 | const char* pakfire_get_distro_id(Pakfire pakfire); | |
100 | const char* pakfire_get_distro_vendor(Pakfire pakfire); | |
101 | const char* pakfire_get_distro_version(Pakfire pakfire); | |
102 | const char* pakfire_get_distro_version_id(Pakfire pakfire); | |
103 | ||
cc18c7b1 MT |
104 | #define pakfire_make_path(pakfire, dst, path) \ |
105 | __pakfire_make_path(pakfire, dst, sizeof(dst) - 1, path) | |
106 | int __pakfire_make_path(Pakfire pakfire, char* dst, size_t length, const char* path); | |
107 | ||
f989dacd MT |
108 | void pakfire_pool_has_changed(Pakfire pakfire); |
109 | void pakfire_pool_apply_changes(Pakfire pakfire); | |
110 | ||
19f3d106 | 111 | Pool* pakfire_get_solv_pool(Pakfire pakfire); |
86671603 | 112 | Queue* pakfire_get_installonly_queue(Pakfire pakfire); |
19f3d106 | 113 | |
2bd03111 MT |
114 | // Archive helpers |
115 | struct archive* pakfire_make_archive_disk_reader(Pakfire pakfire, int internal); | |
86db5219 | 116 | struct archive* pakfire_make_archive_disk_writer(Pakfire pakfire); |
2bd03111 | 117 | |
19f3d106 MT |
118 | #endif |
119 | ||
6e46b18e | 120 | #endif /* PAKFIRE_PAKFIRE_H */ |