Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
return levels;
}
+FILE* pakfire_file_open(struct pakfire_file* file) {
+ FILE* f = fopen(file->abspath, "r");
+ if (!f)
+ ERROR(file->pakfire, "Could not open %s: %m\n", file->abspath);
+
+ return f;
+}
+
int pakfire_file_remove(struct pakfire_file* file) {
if (!*file->abspath) {
errno = EINVAL;
const char* pakfire_file_get_abspath(struct pakfire_file* file);
int pakfire_file_set_abspath(struct pakfire_file* file, const char* path);
+FILE* pakfire_file_open(struct pakfire_file* file);
int pakfire_file_remove(struct pakfire_file* file);
int pakfire_file_cleanup(struct pakfire_file* file);