]> git.ipfire.org Git - people/stevee/pakfire.git/blame - src/libpakfire/include/pakfire/pakfire.h
package: Change type from PakfirePackage to struct pakfire_package
[people/stevee/pakfire.git] / src / libpakfire / include / pakfire / pakfire.h
CommitLineData
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
fb909902
MT
33enum pakfire_flags {
34 PAKFIRE_FLAGS_OFFLINE = (1 << 0),
457feacb 35 PAKFIRE_FLAGS_NON_INTERACTIVE = (1 << 1),
26452aef
MT
36 PAKFIRE_FLAGS_BUILD = (1 << 2),
37 PAKFIRE_FLAGS_DISABLE_CCACHE = (1 << 3),
38 PAKFIRE_FLAGS_DISABLE_SNAPSHOT = (1 << 4),
a651fc41 39 PAKFIRE_FLAGS_DISABLE_RAMDISK = (1 << 5),
fb909902
MT
40};
41
99fad89d 42int pakfire_create(Pakfire* pakfire, const char* path, const char* arch,
b5082d9b 43 const char* conf, int flags, pakfire_log_function_t log, void* data);
6e46b18e
MT
44
45Pakfire pakfire_ref(Pakfire pakfire);
8c916a4d 46Pakfire pakfire_unref(Pakfire pakfire);
6e46b18e
MT
47
48const char* pakfire_get_path(Pakfire pakfire);
d1ed1ada 49
119ec3cf 50int pakfire_clean(Pakfire pakfire, int flags);
03359f52 51int pakfire_refresh(Pakfire pakfire, int flags);
097b6ca6 52
69e754ab 53int pakfire_bind(Pakfire pakfire, const char* src, const char* dst, int flags);
6ef698ea 54
78f7a47c
MT
55int pakfire_copy_in(Pakfire pakfire, const char* src, const char* dst);
56int pakfire_copy_out(Pakfire pakfire, const char* src, const char* dst);
57
6e46b18e
MT
58const char* pakfire_get_arch(Pakfire pakfire);
59
f989dacd
MT
60int pakfire_version_compare(Pakfire pakfire, const char* evr1, const char* evr2);
61
78cc8800 62struct pakfire_repolist* pakfire_get_repos(Pakfire pakfire);
0560505f 63PakfireRepo pakfire_get_repo(Pakfire pakfire, const char* name);
843fcc66 64
6098f82f 65struct pakfire_packagelist* pakfire_whatprovides(Pakfire pakfire, const char* provides, int flags);
b055ddf1
MT
66int pakfire_whatrequires(Pakfire pakfire, const char* what, int flags,
67 struct pakfire_packagelist** list);
6098f82f 68struct pakfire_packagelist* pakfire_search(Pakfire pakfire, const char* what, int flags);
f989dacd 69
12656820
MT
70// Logging
71
12656820
MT
72int pakfire_log_get_priority(Pakfire pakfire);
73void pakfire_log_set_priority(Pakfire pakfire, int priority);
74
f0893704
MT
75// Install/Erase/Update
76
c9b18fbd
MT
77int pakfire_install(Pakfire pakfire, const char** packages, const char** locks,
78 int flags, int* changed);
79int pakfire_erase(Pakfire pakfire, const char** packages, const char** locks,
80 int flags, int* changed);
81int pakfire_update(Pakfire pakfire, const char** packages, const char** locks,
82 int flags, int* changed);
f0893704 83
d37d8d56
MT
84// Check
85
86int pakfire_check(Pakfire pakfire);
87
5ca41ab1
MT
88// Sync
89
550c7c1f 90int pakfire_sync(Pakfire pakfire, int flags, int* changed);
5ca41ab1 91
19f3d106
MT
92#ifdef PAKFIRE_PRIVATE
93
94#include <solv/pool.h>
95
59106773
MT
96#include <pakfire/config.h>
97
708096fe
MT
98int pakfire_on_root(Pakfire pakfire);
99
e9f2fb43
MT
100void pakfire_log(Pakfire pakfire, int priority, const char *file,
101 int line, const char *fn, const char *format, ...)
102 __attribute__((format(printf, 6, 7)));
103
457feacb
MT
104int pakfire_has_flag(Pakfire pakfire, int flag);
105
59106773 106struct pakfire_config* pakfire_get_config(Pakfire pakfire);
457db621 107int pakfire_is_mountpoint(Pakfire pakfire, const char* path);
59106773 108
59ab223d
MT
109const char* pakfire_get_distro_name(Pakfire pakfire);
110const char* pakfire_get_distro_id(Pakfire pakfire);
111const char* pakfire_get_distro_vendor(Pakfire pakfire);
112const char* pakfire_get_distro_version(Pakfire pakfire);
113const char* pakfire_get_distro_version_id(Pakfire pakfire);
114
cc18c7b1
MT
115#define pakfire_make_path(pakfire, dst, path) \
116 __pakfire_make_path(pakfire, dst, sizeof(dst) - 1, path)
117int __pakfire_make_path(Pakfire pakfire, char* dst, size_t length, const char* path);
118
f8015584
MT
119#define pakfire_make_cache_path(pakfire, path, format, ...) \
120 __pakfire_make_cache_path(pakfire, path, sizeof(path) - 1, format, __VA_ARGS__)
121
122int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length,
123 const char* format, ...) __attribute__((format(printf, 4, 5)));
124
f989dacd
MT
125void pakfire_pool_has_changed(Pakfire pakfire);
126void pakfire_pool_apply_changes(Pakfire pakfire);
127
19f3d106
MT
128Pool* pakfire_get_solv_pool(Pakfire pakfire);
129
f8015584
MT
130PakfireRepo pakfire_get_installed_repo(Pakfire pakfire);
131
2bd03111
MT
132// Archive helpers
133struct archive* pakfire_make_archive_disk_reader(Pakfire pakfire, int internal);
86db5219 134struct archive* pakfire_make_archive_disk_writer(Pakfire pakfire);
2bd03111 135
19f3d106
MT
136#endif
137
6e46b18e 138#endif /* PAKFIRE_PAKFIRE_H */