From: Michael Tremer Date: Wed, 30 Jun 2021 18:07:38 +0000 (+0000) Subject: repo: Change type from PakfireRepo to struct pakfire_repo X-Git-Tag: 0.9.28~1140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4651122b29306860934bc71fc26e276ca1773da2;p=pakfire.git repo: Change type from PakfireRepo to struct pakfire_repo Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/archive.c b/src/_pakfire/archive.c index e4496b907..6feb8d8c8 100644 --- a/src/_pakfire/archive.c +++ b/src/_pakfire/archive.c @@ -140,7 +140,7 @@ static PyObject* Archive_extract(ArchiveObject* self, PyObject* args) { static PyObject* Archive_get_package(ArchiveObject* self) { Pakfire pakfire = pakfire_archive_get_pakfire(self->archive); - PakfireRepo repo = pakfire_get_repo(pakfire, "@dummy"); + struct pakfire_repo* repo = pakfire_get_repo(pakfire, "@dummy"); if (!repo) return NULL; diff --git a/src/_pakfire/package.c b/src/_pakfire/package.c index f34ab7665..abf75f3ab 100644 --- a/src/_pakfire/package.c +++ b/src/_pakfire/package.c @@ -383,7 +383,7 @@ static void Package_set_buildtime(PackageObject* self, PyObject* value) { } static PyObject* Package_get_repo(PackageObject* self) { - PakfireRepo repo = pakfire_package_get_repo(self->package); + struct pakfire_repo* repo = pakfire_package_get_repo(self->package); if (!repo) Py_RETURN_NONE; diff --git a/src/_pakfire/pakfire.c b/src/_pakfire/pakfire.c index 2d1ea43c7..666a6df15 100644 --- a/src/_pakfire/pakfire.c +++ b/src/_pakfire/pakfire.c @@ -199,7 +199,7 @@ static PyObject* Pakfire_get_repo(PakfireObject* self, PyObject* args) { if (!PyArg_ParseTuple(args, "s", &name)) return NULL; - PakfireRepo repo = pakfire_get_repo(self->pakfire, name); + struct pakfire_repo* repo = pakfire_get_repo(self->pakfire, name); if (!repo) Py_RETURN_NONE; @@ -783,7 +783,7 @@ static PyObject* Pakfire_get_repos(PakfireObject* self) { goto ERROR; for (unsigned int i = 0; i < l; i++) { - PakfireRepo repo = pakfire_repolist_get(repos, i); + struct pakfire_repo* repo = pakfire_repolist_get(repos, i); if (!repo) continue; diff --git a/src/_pakfire/repo.c b/src/_pakfire/repo.c index 8fe48581e..261b4ffb8 100644 --- a/src/_pakfire/repo.c +++ b/src/_pakfire/repo.c @@ -28,7 +28,7 @@ #include "package.h" #include "repo.h" -PyObject* new_repo(PyTypeObject* type, PakfireRepo repo) { +PyObject* new_repo(PyTypeObject* type, struct pakfire_repo* repo) { RepoObject* self = (RepoObject *)type->tp_alloc(type, 0); if (self) { self->repo = pakfire_repo_ref(repo); diff --git a/src/_pakfire/repo.h b/src/_pakfire/repo.h index b517a3e59..d6b6e0ede 100644 --- a/src/_pakfire/repo.h +++ b/src/_pakfire/repo.h @@ -23,18 +23,18 @@ #include -#include +#include #include "pakfire.h" typedef struct { PyObject_HEAD - PakfireRepo repo; + struct pakfire_repo* repo; int clean; } RepoObject; extern PyTypeObject RepoType; -PyObject* new_repo(PyTypeObject* type, PakfireRepo repo); +PyObject* new_repo(PyTypeObject* type, struct pakfire_repo* repo); #endif /* PYTHON_PAKFIRE_REPO_H */ diff --git a/src/libpakfire/archive.c b/src/libpakfire/archive.c index 375b34b33..b4176725b 100644 --- a/src/libpakfire/archive.c +++ b/src/libpakfire/archive.c @@ -461,7 +461,7 @@ PAKFIRE_EXPORT Pakfire pakfire_archive_get_pakfire(PakfireArchive archive) { static struct pakfire_package* pakfire_archive_get_package(PakfireArchive archive) { if (!archive->package) { - PakfireRepo repo = pakfire_get_repo(archive->pakfire, "@dummy"); + struct pakfire_repo* repo = pakfire_get_repo(archive->pakfire, "@dummy"); if (!repo) return NULL; @@ -1487,7 +1487,7 @@ PAKFIRE_EXPORT size_t pakfire_archive_get_size(PakfireArchive archive) { /* Copy all metadata from this archive to the package object */ -PAKFIRE_EXPORT struct pakfire_package* pakfire_archive_make_package(PakfireArchive archive, PakfireRepo repo) { +PAKFIRE_EXPORT struct pakfire_package* pakfire_archive_make_package(PakfireArchive archive, struct pakfire_repo* repo) { char* name = pakfire_archive_get(archive, "package", "name"); char* arch = pakfire_archive_get(archive, "package", "arch"); diff --git a/src/libpakfire/build.c b/src/libpakfire/build.c index b17bee95a..192f4ba12 100644 --- a/src/libpakfire/build.c +++ b/src/libpakfire/build.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -579,7 +580,7 @@ static int pakfire_build_package_add_scriptlets(Pakfire pakfire, PakfireParser m static int pakfire_build_package(Pakfire pakfire, PakfireParser makefile, const char* id, const char* buildroot, const char* namespace, const char* target) { - PakfireRepo repo = NULL; + struct pakfire_repo* repo = NULL; struct pakfire_package* pkg = NULL; struct pakfire_packager* packager = NULL; @@ -858,7 +859,7 @@ PAKFIRE_EXPORT int pakfire_build(Pakfire pakfire, const char* path, // The default target is the local repository path if (!target) { - PakfireRepo repo = pakfire_get_repo(pakfire, "@local"); + struct pakfire_repo* repo = pakfire_get_repo(pakfire, "@local"); if (repo) { target = pakfire_repo_get_path(repo); pakfire_repo_unref(repo); diff --git a/src/libpakfire/db.c b/src/libpakfire/db.c index e9afcf92b..2d5bb1a07 100644 --- a/src/libpakfire/db.c +++ b/src/libpakfire/db.c @@ -1169,7 +1169,7 @@ int pakfire_db_add_package(struct pakfire_db* db, } // Bind repository name - PakfireRepo repo = pakfire_package_get_repo(pkg); + struct pakfire_repo* repo = pakfire_package_get_repo(pkg); if (repo) { const char* repo_name = pakfire_repo_get_name(repo); pakfire_repo_unref(repo); @@ -1351,7 +1351,7 @@ ERROR: return scriptlet; } -static int pakfire_db_load_package(struct pakfire_db* db, PakfireRepo repo, sqlite3_stmt* stmt) { +static int pakfire_db_load_package(struct pakfire_db* db, struct pakfire_repo* repo, sqlite3_stmt* stmt) { struct pakfire_package* pkg = NULL; int r = 1; @@ -1514,7 +1514,7 @@ ERROR: return r; } -int pakfire_db_load(struct pakfire_db* db, PakfireRepo repo) { +int pakfire_db_load(struct pakfire_db* db, struct pakfire_repo* repo) { sqlite3_stmt* stmt = NULL; int r = 1; diff --git a/src/libpakfire/dist.c b/src/libpakfire/dist.c index c0cc1ee25..8948ce2b7 100644 --- a/src/libpakfire/dist.c +++ b/src/libpakfire/dist.c @@ -372,7 +372,7 @@ PAKFIRE_EXPORT int pakfire_dist(Pakfire pakfire, const char* path, const char* t struct pakfire_packager* packager = NULL; struct pakfire_package* pkg = NULL; - PakfireRepo repo = NULL; + struct pakfire_repo* repo = NULL; // Load makefile int r = pakfire_read_makefile(&makefile, pakfire, path, &error); diff --git a/src/libpakfire/include/pakfire/archive.h b/src/libpakfire/include/pakfire/archive.h index a5ab3c2fd..a57fbf6e2 100644 --- a/src/libpakfire/include/pakfire/archive.h +++ b/src/libpakfire/include/pakfire/archive.h @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -65,7 +66,8 @@ void pakfire_archive_signature_unref(PakfireArchiveSignature signature); const char* pakfire_archive_signature_get_data(PakfireArchiveSignature signature); size_t pakfire_archive_get_size(PakfireArchive archive); -struct pakfire_package* pakfire_archive_make_package(PakfireArchive archive, PakfireRepo repo); +struct pakfire_package* pakfire_archive_make_package( + PakfireArchive archive, struct pakfire_repo* repo); #define PAKFIRE_ARCHIVE_FN_CHECKSUMS "chksums" #define PAKFIRE_ARCHIVE_FN_FILELIST "filelist" diff --git a/src/libpakfire/include/pakfire/db.h b/src/libpakfire/include/pakfire/db.h index 10f700c6f..b978e8721 100644 --- a/src/libpakfire/include/pakfire/db.h +++ b/src/libpakfire/include/pakfire/db.h @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -49,7 +50,7 @@ int pakfire_db_add_package(struct pakfire_db* db, struct pakfire_package* pkg, PakfireArchive archive, int userinstalled); int pakfire_db_remove_package(struct pakfire_db* db, struct pakfire_package* pkg); -int pakfire_db_load(struct pakfire_db* db, PakfireRepo repo); +int pakfire_db_load(struct pakfire_db* db, struct pakfire_repo* repo); struct pakfire_scriptlet* pakfire_db_get_scriptlet( struct pakfire_db* db, struct pakfire_package* pkg, const char* type); diff --git a/src/libpakfire/include/pakfire/package.h b/src/libpakfire/include/pakfire/package.h index 31613fe80..5d213a63e 100644 --- a/src/libpakfire/include/pakfire/package.h +++ b/src/libpakfire/include/pakfire/package.h @@ -25,11 +25,12 @@ #include #include +#include #include struct pakfire_package; -struct pakfire_package* pakfire_package_create(Pakfire pakfire, PakfireRepo repo, +struct pakfire_package* pakfire_package_create(Pakfire pakfire, struct pakfire_repo* repo, const char* name, const char* evr, const char* arch); struct pakfire_package* pakfire_package_ref(struct pakfire_package* pkg); @@ -98,7 +99,7 @@ char** pakfire_package_get_enhances(struct pakfire_package* pkg); int pakfire_package_get_reverse_requires(struct pakfire_package* pkg, struct pakfire_packagelist** list); -PakfireRepo pakfire_package_get_repo(struct pakfire_package* pkg); +struct pakfire_repo* pakfire_package_get_repo(struct pakfire_package* pkg); char* pakfire_package_dump(struct pakfire_package* pkg, int flags); diff --git a/src/libpakfire/include/pakfire/pakfire.h b/src/libpakfire/include/pakfire/pakfire.h index 78d798366..0151fc79f 100644 --- a/src/libpakfire/include/pakfire/pakfire.h +++ b/src/libpakfire/include/pakfire/pakfire.h @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -64,7 +65,7 @@ const char* pakfire_get_arch(Pakfire pakfire); int pakfire_version_compare(Pakfire pakfire, const char* evr1, const char* evr2); struct pakfire_repolist* pakfire_get_repos(Pakfire pakfire); -PakfireRepo pakfire_get_repo(Pakfire pakfire, const char* name); +struct pakfire_repo* pakfire_get_repo(Pakfire pakfire, const char* name); int pakfire_whatprovides(Pakfire pakfire, const char* what, int flags, struct pakfire_packagelist** list); @@ -140,7 +141,7 @@ void pakfire_pool_apply_changes(Pakfire pakfire); Pool* pakfire_get_solv_pool(Pakfire pakfire); -PakfireRepo pakfire_get_installed_repo(Pakfire pakfire); +struct pakfire_repo* pakfire_get_installed_repo(Pakfire pakfire); // Archive helpers struct archive* pakfire_make_archive_disk_reader(Pakfire pakfire, int internal); diff --git a/src/libpakfire/include/pakfire/parser.h b/src/libpakfire/include/pakfire/parser.h index 709f781a5..dd92d1750 100644 --- a/src/libpakfire/include/pakfire/parser.h +++ b/src/libpakfire/include/pakfire/parser.h @@ -24,6 +24,7 @@ #include #include +#include #include enum pakfire_parser_flags { @@ -65,7 +66,7 @@ const char* pakfire_parser_get_namespace(PakfireParser parser); int pakfire_parser_set_namespace(PakfireParser parser, const char* namespace); int pakfire_parser_create_package(PakfireParser parser, - struct pakfire_package** pkg, PakfireRepo repo, const char* namespace, const char* default_arch); + struct pakfire_package** pkg, struct pakfire_repo* repo, const char* namespace, const char* default_arch); // Errors int pakfire_parser_error_create(struct pakfire_parser_error** error, diff --git a/src/libpakfire/include/pakfire/repo.h b/src/libpakfire/include/pakfire/repo.h index b7c8018a1..67ec53cb4 100644 --- a/src/libpakfire/include/pakfire/repo.h +++ b/src/libpakfire/include/pakfire/repo.h @@ -25,66 +25,68 @@ #include #include +struct pakfire_repo; + #include #include -PakfireRepo pakfire_repo_create(Pakfire pakfire, const char* name); +struct pakfire_repo* pakfire_repo_create(Pakfire pakfire, const char* name); -PakfireRepo pakfire_repo_ref(PakfireRepo repo); -PakfireRepo pakfire_repo_unref(PakfireRepo repo); -Pakfire pakfire_repo_get_pakfire(PakfireRepo repo); +struct pakfire_repo* pakfire_repo_ref(struct pakfire_repo* repo); +struct pakfire_repo* pakfire_repo_unref(struct pakfire_repo* repo); +Pakfire pakfire_repo_get_pakfire(struct pakfire_repo* repo); -int pakfire_repo_clear(PakfireRepo repo); +int pakfire_repo_clear(struct pakfire_repo* repo); -int pakfire_repo_identical(PakfireRepo repo1, PakfireRepo repo2); -int pakfire_repo_cmp(PakfireRepo repo1, PakfireRepo repo2); -int pakfire_repo_count(PakfireRepo repo); +int pakfire_repo_identical(struct pakfire_repo* repo1, struct pakfire_repo* repo2); +int pakfire_repo_cmp(struct pakfire_repo* repo1, struct pakfire_repo* repo2); +int pakfire_repo_count(struct pakfire_repo* repo); -const char* pakfire_repo_get_name(PakfireRepo repo); +const char* pakfire_repo_get_name(struct pakfire_repo* repo); -const char* pakfire_repo_get_description(PakfireRepo repo); -int pakfire_repo_set_description(PakfireRepo repo, const char* description); +const char* pakfire_repo_get_description(struct pakfire_repo* repo); +int pakfire_repo_set_description(struct pakfire_repo* repo, const char* description); -int pakfire_repo_get_enabled(PakfireRepo repo); -void pakfire_repo_set_enabled(PakfireRepo repo, int enabled); +int pakfire_repo_get_enabled(struct pakfire_repo* repo); +void pakfire_repo_set_enabled(struct pakfire_repo* repo, int enabled); -int pakfire_repo_get_priority(PakfireRepo repo); -void pakfire_repo_set_priority(PakfireRepo repo, int priority); +int pakfire_repo_get_priority(struct pakfire_repo* repo); +void pakfire_repo_set_priority(struct pakfire_repo* repo, int priority); -const char* pakfire_repo_get_baseurl(PakfireRepo repo); -int pakfire_repo_set_baseurl(PakfireRepo repo, const char* baseurl); +const char* pakfire_repo_get_baseurl(struct pakfire_repo* repo); +int pakfire_repo_set_baseurl(struct pakfire_repo* repo, const char* baseurl); -const char* pakfire_repo_get_keyfile(PakfireRepo repo); -int pakfire_repo_set_keyfile(PakfireRepo repo, const char* keyfile); +const char* pakfire_repo_get_keyfile(struct pakfire_repo* repo); +int pakfire_repo_set_keyfile(struct pakfire_repo* repo, const char* keyfile); -const char* pakfire_repo_get_mirrorlist_url(PakfireRepo repo); -int pakfire_repo_set_mirrorlist_url(PakfireRepo repo, const char* url); +const char* pakfire_repo_get_mirrorlist_url(struct pakfire_repo* repo); +int pakfire_repo_set_mirrorlist_url(struct pakfire_repo* repo, const char* url); -struct pakfire_mirrorlist* pakfire_repo_get_mirrors(PakfireRepo repo); +struct pakfire_mirrorlist* pakfire_repo_get_mirrors(struct pakfire_repo* repo); -char* pakfire_repo_get_config(PakfireRepo repo); +char* pakfire_repo_get_config(struct pakfire_repo* repo); -int pakfire_repo_is_installed_repo(PakfireRepo repo); +int pakfire_repo_is_installed_repo(struct pakfire_repo* repo); -int pakfire_repo_read_solv(PakfireRepo repo, const char* filename, int flags); -int pakfire_repo_read_solv_fp(PakfireRepo repo, FILE *f, int flags); +int pakfire_repo_read_solv(struct pakfire_repo* repo, const char* filename, int flags); +int pakfire_repo_read_solv_fp(struct pakfire_repo* repo, FILE *f, int flags); -int pakfire_repo_write_solv(PakfireRepo repo, const char* filename, int flags); -int pakfire_repo_write_solv_fp(PakfireRepo repo, FILE *f, int flags); +int pakfire_repo_write_solv(struct pakfire_repo* repo, const char* filename, int flags); +int pakfire_repo_write_solv_fp(struct pakfire_repo* repo, FILE *f, int flags); -struct pakfire_package* pakfire_repo_add_archive(PakfireRepo repo, PakfireArchive archive); +struct pakfire_package* pakfire_repo_add_archive(struct pakfire_repo* repo, PakfireArchive archive); // Cache -int pakfire_repo_clean(PakfireRepo repo, int flags); +int pakfire_repo_clean(struct pakfire_repo* repo, int flags); // Scan -int pakfire_repo_scan(PakfireRepo repo, int flags); +int pakfire_repo_scan(struct pakfire_repo* repo, int flags); // Refresh -int pakfire_repo_refresh(PakfireRepo repo, int force); +int pakfire_repo_refresh(struct pakfire_repo* repo, int force); #ifdef PAKFIRE_PRIVATE @@ -94,18 +96,18 @@ int pakfire_repo_refresh(PakfireRepo repo, int force); #include int pakfire_repo_import(Pakfire pakfire, struct pakfire_config* config); -const char* pakfire_repo_get_path(PakfireRepo repo); +const char* pakfire_repo_get_path(struct pakfire_repo* repo); -void pakfire_repo_internalize(PakfireRepo repo); -Id pakfire_repo_add_solvable(PakfireRepo repo); +void pakfire_repo_internalize(struct pakfire_repo* repo); +Id pakfire_repo_add_solvable(struct pakfire_repo* repo); -PakfireRepo pakfire_repo_create_from_repo(Pakfire pakfire, Repo* r); +struct pakfire_repo* pakfire_repo_create_from_repo(Pakfire pakfire, Repo* r); void pakfire_repo_free_all(Pakfire pakfire); -Repo* pakfire_repo_get_repo(PakfireRepo repo); -Repodata* pakfire_repo_get_repodata(PakfireRepo repo); +Repo* pakfire_repo_get_repo(struct pakfire_repo* repo); +Repodata* pakfire_repo_get_repodata(struct pakfire_repo* repo); -struct pakfire_mirrorlist* pakfire_repo_get_mirrorlist(PakfireRepo repo); +struct pakfire_mirrorlist* pakfire_repo_get_mirrorlist(struct pakfire_repo* repo); #endif diff --git a/src/libpakfire/include/pakfire/repolist.h b/src/libpakfire/include/pakfire/repolist.h index 528ca8c09..3f47b60aa 100644 --- a/src/libpakfire/include/pakfire/repolist.h +++ b/src/libpakfire/include/pakfire/repolist.h @@ -36,7 +36,7 @@ void pakfire_repolist_clear(struct pakfire_repolist* list); size_t pakfire_repolist_size(struct pakfire_repolist* list); int pakfire_repolist_empty(struct pakfire_repolist* list); -PakfireRepo pakfire_repolist_get(struct pakfire_repolist* list, size_t index); -int pakfire_repolist_append(struct pakfire_repolist* list, PakfireRepo repo); +struct pakfire_repo* pakfire_repolist_get(struct pakfire_repolist* list, size_t index); +int pakfire_repolist_append(struct pakfire_repolist* list, struct pakfire_repo* repo); #endif /* PAKFIRE_REPOLIST_H */ diff --git a/src/libpakfire/include/pakfire/types.h b/src/libpakfire/include/pakfire/types.h index d36212cf9..599a00e98 100644 --- a/src/libpakfire/include/pakfire/types.h +++ b/src/libpakfire/include/pakfire/types.h @@ -27,7 +27,6 @@ typedef struct _PakfireArchiveSignature* PakfireArchiveSignature; typedef struct _PakfireFilelist* PakfireFilelist; typedef struct _PakfireKey* PakfireKey; typedef struct _PakfireParser* PakfireParser; -typedef struct _PakfireRepo* PakfireRepo; typedef struct _PakfireSolution* PakfireSolution; #endif /* PAKFIRE_TYPES_H */ diff --git a/src/libpakfire/package.c b/src/libpakfire/package.c index 954ac84a5..c016cf899 100644 --- a/src/libpakfire/package.c +++ b/src/libpakfire/package.c @@ -48,7 +48,7 @@ struct pakfire_package { // Reference to this package in the SOLV pool Id id; - PakfireRepo repo; + struct pakfire_repo* repo; char nevra[NAME_MAX]; @@ -77,7 +77,7 @@ struct pakfire_package* pakfire_package_create_from_solvable(Pakfire pakfire, Id return pkg; } -PAKFIRE_EXPORT struct pakfire_package* pakfire_package_create(Pakfire pakfire, PakfireRepo repo, const char* name, const char* evr, const char* arch) { +PAKFIRE_EXPORT struct pakfire_package* pakfire_package_create(Pakfire pakfire, struct pakfire_repo* repo, const char* name, const char* evr, const char* arch) { Id id = pakfire_repo_add_solvable(repo); if (!id) return NULL; @@ -155,8 +155,8 @@ PAKFIRE_EXPORT int pakfire_package_cmp(struct pakfire_package* pkg1, struct pakf return ret; // Check repositories - PakfireRepo repo1 = pakfire_package_get_repo(pkg1); - PakfireRepo repo2 = pakfire_package_get_repo(pkg2); + struct pakfire_repo* repo1 = pakfire_package_get_repo(pkg1); + struct pakfire_repo* repo2 = pakfire_package_get_repo(pkg2); if (repo1 && repo2) { ret = pakfire_repo_cmp(repo1, repo2); @@ -277,7 +277,7 @@ int pakfire_package_is_source(struct pakfire_package* pkg) { } static void pakfire_package_internalize_repo(struct pakfire_package* pkg) { - PakfireRepo repo = pakfire_package_get_repo(pkg); + struct pakfire_repo* repo = pakfire_package_get_repo(pkg); if (repo) { pakfire_repo_internalize(repo); pakfire_repo_unref(repo); @@ -758,7 +758,7 @@ ERROR: return r; } -PAKFIRE_EXPORT PakfireRepo pakfire_package_get_repo(struct pakfire_package* pkg) { +PAKFIRE_EXPORT struct pakfire_repo* pakfire_package_get_repo(struct pakfire_package* pkg) { if (!pkg->repo) { Solvable* s = get_solvable(pkg); @@ -838,7 +838,7 @@ PAKFIRE_EXPORT char* pakfire_package_dump(struct pakfire_package* pkg, int flags pakfire_package_dump_add_line_size(&string, _("Download size"), downloadsize); } - PakfireRepo repo = pakfire_package_get_repo(pkg); + struct pakfire_repo* repo = pakfire_package_get_repo(pkg); if (repo) { const char* repo_name = pakfire_repo_get_name(repo); pakfire_package_dump_add_line(&string, _("Repo"), repo_name); @@ -988,7 +988,7 @@ PAKFIRE_EXPORT PakfireArchive pakfire_package_get_archive(struct pakfire_package static int pakfire_package_fetch_legacy_filelist(struct pakfire_package* pkg, PakfireFilelist filelist) { pakfire_package_internalize_repo(pkg); - PakfireRepo repo = pakfire_package_get_repo(pkg); + struct pakfire_repo* repo = pakfire_package_get_repo(pkg); Solvable* s = get_solvable(pkg); Pool* p = pakfire_get_solv_pool(pkg->pakfire); Repo* r = pakfire_repo_get_repo(repo); @@ -1084,7 +1084,7 @@ PAKFIRE_EXPORT PakfireFilelist pakfire_package_get_filelist(struct pakfire_packa static int pakfire_package_append_file(struct pakfire_package* pkg, const char* path) { // Fetch repodata - PakfireRepo repo = pakfire_package_get_repo(pkg); + struct pakfire_repo* repo = pakfire_package_get_repo(pkg); Repodata* repodata = pakfire_repo_get_repodata(repo); pakfire_repo_unref(repo); diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index c7e89b5b4..295a1fdcb 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -392,8 +392,8 @@ static Id pakfire_namespace_callback(Pool* pool, void* data, Id ns, Id id) { static int pakfire_populate_pool(Pakfire pakfire) { struct pakfire_db* db; - PakfireRepo repo = NULL; - PakfireRepo dummy = NULL; + struct pakfire_repo* repo = NULL; + struct pakfire_repo* dummy = NULL; int r; // Initialize the pool @@ -1055,8 +1055,8 @@ PAKFIRE_EXPORT int pakfire_bind(Pakfire pakfire, const char* src, const char* ds } static int pakfire_foreach_repo(Pakfire pakfire, - int (*func)(PakfireRepo repo, int flags), int flags) { - PakfireRepo repo; + int (*func)(struct pakfire_repo* repo, int flags), int flags) { + struct pakfire_repo* repo; Repo* solv_repo; int i; @@ -1241,7 +1241,7 @@ PAKFIRE_EXPORT struct pakfire_repolist* pakfire_get_repos(Pakfire pakfire) { if (strcmp(solv_repo->name, "@dummy") == 0) continue; - PakfireRepo repo = pakfire_repo_create_from_repo(pakfire, solv_repo); + struct pakfire_repo* repo = pakfire_repo_create_from_repo(pakfire, solv_repo); if (!repo) { r = 1; goto ERROR; @@ -1263,7 +1263,7 @@ ERROR: return NULL; } -PAKFIRE_EXPORT PakfireRepo pakfire_get_repo(Pakfire pakfire, const char* name) { +PAKFIRE_EXPORT struct pakfire_repo* pakfire_get_repo(Pakfire pakfire, const char* name) { Pool* pool = pakfire_get_solv_pool(pakfire); Repo* repo; @@ -1278,7 +1278,7 @@ PAKFIRE_EXPORT PakfireRepo pakfire_get_repo(Pakfire pakfire, const char* name) { return NULL; } -PakfireRepo pakfire_get_installed_repo(Pakfire pakfire) { +struct pakfire_repo* pakfire_get_installed_repo(Pakfire pakfire) { if (!pakfire->pool->installed) return NULL; diff --git a/src/libpakfire/parser.c b/src/libpakfire/parser.c index fa4c74f3d..7d1020b7e 100644 --- a/src/libpakfire/parser.c +++ b/src/libpakfire/parser.c @@ -868,7 +868,7 @@ ERROR: } PAKFIRE_EXPORT int pakfire_parser_create_package(PakfireParser parser, - struct pakfire_package** pkg, PakfireRepo repo, const char* namespace, const char* default_arch) { + struct pakfire_package** pkg, struct pakfire_repo* repo, const char* namespace, const char* default_arch) { int r = 1; char* name = NULL; diff --git a/src/libpakfire/repo.c b/src/libpakfire/repo.c index 8b90d55ef..046197e02 100644 --- a/src/libpakfire/repo.c +++ b/src/libpakfire/repo.c @@ -68,16 +68,17 @@ struct pakfire_repo_appdata { char mirrorlist[PATH_MAX]; }; -struct _PakfireRepo { +struct pakfire_repo { Pakfire pakfire; + int nrefs; + Repo* repo; struct pakfire_repo_appdata* appdata; - int nrefs; struct pakfire_mirrorlist* mirrorlist; }; -static int pakfire_repo_is_internal(PakfireRepo repo) { +static int pakfire_repo_is_internal(struct pakfire_repo* repo) { const char* name = pakfire_repo_get_name(repo); if (!name) return 0; @@ -107,7 +108,7 @@ int pakfire_repo_import(Pakfire pakfire, struct pakfire_config* config) { DEBUG(pakfire, "Creating repository %s\n", name); // Create a new repository - PakfireRepo repo = pakfire_repo_create(pakfire, name); + struct pakfire_repo* repo = pakfire_repo_create(pakfire, name); if (!repo) { ERROR(pakfire, "Could not create repository '%s': %m\n", name); r = 1; @@ -149,11 +150,11 @@ ERROR: return r; } -Id pakfire_repo_add_solvable(PakfireRepo repo) { +Id pakfire_repo_add_solvable(struct pakfire_repo* repo) { return repo_add_solvable(repo->repo); } -struct pakfire_mirrorlist* pakfire_repo_get_mirrorlist(PakfireRepo repo) { +struct pakfire_mirrorlist* pakfire_repo_get_mirrorlist(struct pakfire_repo* repo) { if (!repo->mirrorlist) { // No cache path set if (!*repo->appdata->mirrorlist) @@ -182,7 +183,7 @@ struct pakfire_mirrorlist* pakfire_repo_get_mirrorlist(PakfireRepo repo) { return pakfire_mirrorlist_ref(repo->mirrorlist); } -static int pakfire_repo_retrieve(PakfireRepo repo, const char* title, +static int pakfire_repo_retrieve(struct pakfire_repo* repo, const char* title, const char* url, const char* path, enum pakfire_transfer_flags flags) { struct pakfire_downloader* downloader; int r = pakfire_downloader_create(&downloader, repo->pakfire); @@ -203,7 +204,7 @@ static int pakfire_repo_retrieve(PakfireRepo repo, const char* title, return r; } -static int pakfire_repo_download_database(PakfireRepo repo, const char* database, +static int pakfire_repo_download_database(struct pakfire_repo* repo, const char* database, const char* cache_path) { char title[NAME_MAX]; char database_url[PATH_MAX]; @@ -225,7 +226,7 @@ static int pakfire_repo_download_database(PakfireRepo repo, const char* database return pakfire_repo_retrieve(repo, title, database_url, cache_path, 0); } -static int pakfire_repo_read_metadata(PakfireRepo repo, const char* path, int refresh) { +static int pakfire_repo_read_metadata(struct pakfire_repo* repo, const char* path, int refresh) { int r; struct json_object* json = pakfire_json_parse_from_file(repo->pakfire, path); @@ -290,7 +291,7 @@ ERROR: return r; } -static int pakfire_repo_refresh_mirrorlist(PakfireRepo repo, const int force) { +static int pakfire_repo_refresh_mirrorlist(struct pakfire_repo* repo, const int force) { // This repository does not have a mirrorlist if (!repo->appdata->mirrorlist_url || !*repo->appdata->mirrorlist) return 0; @@ -309,7 +310,7 @@ static int pakfire_repo_refresh_mirrorlist(PakfireRepo repo, const int force) { repo->appdata->mirrorlist_url, repo->appdata->mirrorlist, PAKFIRE_TRANSFER_NOPROGRESS); } -static int pakfire_repo_refresh_metadata(PakfireRepo repo, const int force) { +static int pakfire_repo_refresh_metadata(struct pakfire_repo* repo, const int force) { // Check if this needs to be refreshed if (!force) { time_t age = pakfire_path_age(repo->appdata->metadata); @@ -350,7 +351,7 @@ static void free_repo_appdata(struct pakfire_repo_appdata* appdata) { free(appdata); } -static void pakfire_repo_free(PakfireRepo repo, const int free_repo) { +static void pakfire_repo_free(struct pakfire_repo* repo, const int free_repo) { if (free_repo) { free_repo_appdata(repo->repo->appdata); repo_free(repo->repo, 0); @@ -376,8 +377,8 @@ void pakfire_repo_free_all(Pakfire pakfire) { } } -PAKFIRE_EXPORT PakfireRepo pakfire_repo_create(Pakfire pakfire, const char* name) { - PakfireRepo repo; +PAKFIRE_EXPORT struct pakfire_repo* pakfire_repo_create(Pakfire pakfire, const char* name) { + struct pakfire_repo* repo; int r; // Return existing repositories with the same name @@ -445,8 +446,8 @@ ERROR: return NULL; } -PakfireRepo pakfire_repo_create_from_repo(Pakfire pakfire, Repo* r) { - PakfireRepo repo = calloc(1, sizeof(*repo)); +struct pakfire_repo* pakfire_repo_create_from_repo(Pakfire pakfire, Repo* r) { + struct pakfire_repo* repo = calloc(1, sizeof(*repo)); if (repo) { DEBUG(pakfire, "Allocated Repo at %p\n", repo); repo->nrefs = 1; @@ -461,13 +462,13 @@ PakfireRepo pakfire_repo_create_from_repo(Pakfire pakfire, Repo* r) { return repo; } -PAKFIRE_EXPORT PakfireRepo pakfire_repo_ref(PakfireRepo repo) { +PAKFIRE_EXPORT struct pakfire_repo* pakfire_repo_ref(struct pakfire_repo* repo) { repo->nrefs++; return repo; } -PAKFIRE_EXPORT PakfireRepo pakfire_repo_unref(PakfireRepo repo) { +PAKFIRE_EXPORT struct pakfire_repo* pakfire_repo_unref(struct pakfire_repo* repo) { if (--repo->nrefs > 0) return repo; @@ -476,11 +477,11 @@ PAKFIRE_EXPORT PakfireRepo pakfire_repo_unref(PakfireRepo repo) { return NULL; } -PAKFIRE_EXPORT Pakfire pakfire_repo_get_pakfire(PakfireRepo repo) { +PAKFIRE_EXPORT Pakfire pakfire_repo_get_pakfire(struct pakfire_repo* repo) { return pakfire_ref(repo->pakfire); } -int pakfire_repo_clear(PakfireRepo repo) { +int pakfire_repo_clear(struct pakfire_repo* repo) { repo_empty(repo->repo, 0); // Allocate repodata @@ -494,22 +495,22 @@ int pakfire_repo_clear(PakfireRepo repo) { return 0; } -Repo* pakfire_repo_get_repo(PakfireRepo repo) { +Repo* pakfire_repo_get_repo(struct pakfire_repo* repo) { return repo->repo; } -Repodata* pakfire_repo_get_repodata(PakfireRepo repo) { +Repodata* pakfire_repo_get_repodata(struct pakfire_repo* repo) { return repo->appdata->repodata; } -PAKFIRE_EXPORT int pakfire_repo_identical(PakfireRepo repo1, PakfireRepo repo2) { +PAKFIRE_EXPORT int pakfire_repo_identical(struct pakfire_repo* repo1, struct pakfire_repo* repo2) { Repo* r1 = repo1->repo; Repo* r2 = repo2->repo; return strcmp(r1->name, r2->name); } -PAKFIRE_EXPORT int pakfire_repo_cmp(PakfireRepo repo1, PakfireRepo repo2) { +PAKFIRE_EXPORT int pakfire_repo_cmp(struct pakfire_repo* repo1, struct pakfire_repo* repo2) { Repo* r1 = repo1->repo; Repo* r2 = repo2->repo; @@ -522,7 +523,7 @@ PAKFIRE_EXPORT int pakfire_repo_cmp(PakfireRepo repo1, PakfireRepo repo2) { return strcmp(r1->name, r2->name); } -PAKFIRE_EXPORT int pakfire_repo_count(PakfireRepo repo) { +PAKFIRE_EXPORT int pakfire_repo_count(struct pakfire_repo* repo) { Pool* pool = pakfire_get_solv_pool(repo->pakfire); int cnt = 0; @@ -535,19 +536,19 @@ PAKFIRE_EXPORT int pakfire_repo_count(PakfireRepo repo) { return cnt; } -void pakfire_repo_internalize(PakfireRepo repo) { +void pakfire_repo_internalize(struct pakfire_repo* repo) { repo_internalize(repo->repo); } -PAKFIRE_EXPORT const char* pakfire_repo_get_name(PakfireRepo repo) { +PAKFIRE_EXPORT const char* pakfire_repo_get_name(struct pakfire_repo* repo) { return repo->repo->name; } -PAKFIRE_EXPORT const char* pakfire_repo_get_description(PakfireRepo repo) { +PAKFIRE_EXPORT const char* pakfire_repo_get_description(struct pakfire_repo* repo) { return repo->appdata->description; } -PAKFIRE_EXPORT int pakfire_repo_set_description(PakfireRepo repo, const char* description) { +PAKFIRE_EXPORT int pakfire_repo_set_description(struct pakfire_repo* repo, const char* description) { if (repo->appdata->description) free(repo->appdata->description); @@ -559,29 +560,29 @@ PAKFIRE_EXPORT int pakfire_repo_set_description(PakfireRepo repo, const char* de return 0; } -PAKFIRE_EXPORT int pakfire_repo_get_enabled(PakfireRepo repo) { +PAKFIRE_EXPORT int pakfire_repo_get_enabled(struct pakfire_repo* repo) { return !repo->repo->disabled; } -PAKFIRE_EXPORT void pakfire_repo_set_enabled(PakfireRepo repo, int enabled) { +PAKFIRE_EXPORT void pakfire_repo_set_enabled(struct pakfire_repo* repo, int enabled) { repo->repo->disabled = !enabled; pakfire_pool_has_changed(repo->pakfire); } -PAKFIRE_EXPORT int pakfire_repo_get_priority(PakfireRepo repo) { +PAKFIRE_EXPORT int pakfire_repo_get_priority(struct pakfire_repo* repo) { return repo->repo->priority; } -PAKFIRE_EXPORT void pakfire_repo_set_priority(PakfireRepo repo, int priority) { +PAKFIRE_EXPORT void pakfire_repo_set_priority(struct pakfire_repo* repo, int priority) { repo->repo->priority = priority; } -PAKFIRE_EXPORT const char* pakfire_repo_get_baseurl(PakfireRepo repo) { +PAKFIRE_EXPORT const char* pakfire_repo_get_baseurl(struct pakfire_repo* repo) { return repo->appdata->baseurl; } -static char* pakfire_repo_url_replace(PakfireRepo repo, const char* url) { +static char* pakfire_repo_url_replace(struct pakfire_repo* repo, const char* url) { if (!url) return NULL; @@ -625,7 +626,7 @@ static char* pakfire_repo_url_replace(PakfireRepo repo, const char* url) { return buffer; } -PAKFIRE_EXPORT int pakfire_repo_set_baseurl(PakfireRepo repo, const char* baseurl) { +PAKFIRE_EXPORT int pakfire_repo_set_baseurl(struct pakfire_repo* repo, const char* baseurl) { if (repo->appdata->baseurl) free(repo->appdata->baseurl); @@ -637,25 +638,25 @@ PAKFIRE_EXPORT int pakfire_repo_set_baseurl(PakfireRepo repo, const char* baseur return 0; } -static int pakfire_repo_is_local(PakfireRepo repo) { +static int pakfire_repo_is_local(struct pakfire_repo* repo) { if (!*repo->appdata->baseurl) return 0; return pakfire_string_startswith(repo->appdata->baseurl, "file://"); } -const char* pakfire_repo_get_path(PakfireRepo repo) { +const char* pakfire_repo_get_path(struct pakfire_repo* repo) { if (!pakfire_repo_is_local(repo)) return NULL; return repo->appdata->baseurl + strlen("file://"); } -PAKFIRE_EXPORT const char* pakfire_repo_get_keyfile(PakfireRepo repo) { +PAKFIRE_EXPORT const char* pakfire_repo_get_keyfile(struct pakfire_repo* repo) { return repo->appdata->keyfile; } -PAKFIRE_EXPORT int pakfire_repo_set_keyfile(PakfireRepo repo, const char* keyfile) { +PAKFIRE_EXPORT int pakfire_repo_set_keyfile(struct pakfire_repo* repo, const char* keyfile) { if (repo->appdata->keyfile) free(repo->appdata->keyfile); @@ -667,11 +668,11 @@ PAKFIRE_EXPORT int pakfire_repo_set_keyfile(PakfireRepo repo, const char* keyfil return 0; } -PAKFIRE_EXPORT const char* pakfire_repo_get_mirrorlist_url(PakfireRepo repo) { +PAKFIRE_EXPORT const char* pakfire_repo_get_mirrorlist_url(struct pakfire_repo* repo) { return repo->appdata->mirrorlist_url; } -PAKFIRE_EXPORT int pakfire_repo_set_mirrorlist_url(PakfireRepo repo, const char* url) { +PAKFIRE_EXPORT int pakfire_repo_set_mirrorlist_url(struct pakfire_repo* repo, const char* url) { if (repo->appdata->mirrorlist_url) free(repo->appdata->mirrorlist_url); @@ -683,7 +684,7 @@ PAKFIRE_EXPORT int pakfire_repo_set_mirrorlist_url(PakfireRepo repo, const char* return 0; } -PAKFIRE_EXPORT char* pakfire_repo_get_config(PakfireRepo repo) { +PAKFIRE_EXPORT char* pakfire_repo_get_config(struct pakfire_repo* repo) { if (pakfire_repo_is_installed_repo(repo) == 0) return NULL; @@ -721,8 +722,8 @@ PAKFIRE_EXPORT char* pakfire_repo_get_config(PakfireRepo repo) { return strdup(buffer); } -PAKFIRE_EXPORT int pakfire_repo_is_installed_repo(PakfireRepo repo) { - PakfireRepo installed_repo = pakfire_get_installed_repo(repo->pakfire); +PAKFIRE_EXPORT int pakfire_repo_is_installed_repo(struct pakfire_repo* repo) { + struct pakfire_repo* installed_repo = pakfire_get_installed_repo(repo->pakfire); if (!installed_repo) return 1; @@ -733,7 +734,7 @@ PAKFIRE_EXPORT int pakfire_repo_is_installed_repo(PakfireRepo repo) { return r; } -PAKFIRE_EXPORT int pakfire_repo_read_solv(PakfireRepo repo, const char* filename, int flags) { +PAKFIRE_EXPORT int pakfire_repo_read_solv(struct pakfire_repo* repo, const char* filename, int flags) { FILE* f = fopen(filename, "rb"); if (!f) return 1; @@ -744,7 +745,7 @@ PAKFIRE_EXPORT int pakfire_repo_read_solv(PakfireRepo repo, const char* filename return ret; } -PAKFIRE_EXPORT int pakfire_repo_read_solv_fp(PakfireRepo repo, FILE *f, int flags) { +PAKFIRE_EXPORT int pakfire_repo_read_solv_fp(struct pakfire_repo* repo, FILE *f, int flags) { f = pakfire_xfopen(f, "r"); if (!f) return 1; @@ -781,7 +782,7 @@ PAKFIRE_EXPORT int pakfire_repo_read_solv_fp(PakfireRepo repo, FILE *f, int flag return 0; } -PAKFIRE_EXPORT int pakfire_repo_write_solv(PakfireRepo repo, const char* filename, int flags) { +PAKFIRE_EXPORT int pakfire_repo_write_solv(struct pakfire_repo* repo, const char* filename, int flags) { FILE* f = fopen(filename, "wb"); if (!f) return 1; @@ -792,17 +793,17 @@ PAKFIRE_EXPORT int pakfire_repo_write_solv(PakfireRepo repo, const char* filenam return ret; } -PAKFIRE_EXPORT int pakfire_repo_write_solv_fp(PakfireRepo repo, FILE *f, int flags) { +PAKFIRE_EXPORT int pakfire_repo_write_solv_fp(struct pakfire_repo* repo, FILE *f, int flags) { pakfire_repo_internalize(repo); return repo_write(repo->repo, f); } -PAKFIRE_EXPORT struct pakfire_package* pakfire_repo_add_archive(PakfireRepo repo, PakfireArchive archive) { +PAKFIRE_EXPORT struct pakfire_package* pakfire_repo_add_archive(struct pakfire_repo* repo, PakfireArchive archive) { return pakfire_archive_make_package(archive, repo); } -PAKFIRE_EXPORT int pakfire_repo_clean(PakfireRepo repo, int flags) { +PAKFIRE_EXPORT int pakfire_repo_clean(struct pakfire_repo* repo, int flags) { char cache_path[PATH_MAX]; // Drop all meta-data from memory @@ -825,7 +826,7 @@ PAKFIRE_EXPORT int pakfire_repo_clean(PakfireRepo repo, int flags) { return pakfire_rmtree(cache_path, 0); } -static int pakfire_repo_scan_file(PakfireRepo repo, const char* path) { +static int pakfire_repo_scan_file(struct pakfire_repo* repo, const char* path) { DEBUG(repo->pakfire, "Scanning %s...\n", path); PakfireArchive archive; @@ -846,7 +847,7 @@ static int pakfire_repo_scan_file(PakfireRepo repo, const char* path) { return 0; } -PAKFIRE_EXPORT int pakfire_repo_scan(PakfireRepo repo, int flags) { +PAKFIRE_EXPORT int pakfire_repo_scan(struct pakfire_repo* repo, int flags) { struct pakfire_progressbar* progressbar = NULL; const char* path = pakfire_repo_get_path(repo); @@ -940,7 +941,7 @@ ERROR: return r; } -PAKFIRE_EXPORT int pakfire_repo_refresh(PakfireRepo repo, int force) { +PAKFIRE_EXPORT int pakfire_repo_refresh(struct pakfire_repo* repo, int force) { const char* name = pakfire_repo_get_name(repo); int r; diff --git a/src/libpakfire/repolist.c b/src/libpakfire/repolist.c index d215d7340..96e417372 100644 --- a/src/libpakfire/repolist.c +++ b/src/libpakfire/repolist.c @@ -29,14 +29,14 @@ struct pakfire_repolist { int nrefs; - PakfireRepo* elements; + struct pakfire_repo** elements; size_t elements_size; size_t size; }; static int pakfire_repolist_grow(struct pakfire_repolist* list, size_t size) { - PakfireRepo* elements = reallocarray(list->elements, + struct pakfire_repo** elements = reallocarray(list->elements, list->elements_size + size, sizeof(*list->elements)); if (!elements) return -errno; @@ -101,14 +101,14 @@ PAKFIRE_EXPORT int pakfire_repolist_empty(struct pakfire_repolist* list) { return list->size == 0; } -PAKFIRE_EXPORT PakfireRepo pakfire_repolist_get(struct pakfire_repolist* list, size_t index) { +PAKFIRE_EXPORT struct pakfire_repo* pakfire_repolist_get(struct pakfire_repolist* list, size_t index) { if (index >= list->size) return NULL; return pakfire_repo_ref(list->elements[index]); } -PAKFIRE_EXPORT int pakfire_repolist_append(struct pakfire_repolist* list, PakfireRepo repo) { +PAKFIRE_EXPORT int pakfire_repolist_append(struct pakfire_repolist* list, struct pakfire_repo* repo) { if (!repo) return EINVAL; diff --git a/src/libpakfire/request.c b/src/libpakfire/request.c index 19d3f3f4c..6767ca703 100644 --- a/src/libpakfire/request.c +++ b/src/libpakfire/request.c @@ -396,7 +396,7 @@ static int pakfire_request_add_job(struct pakfire_request* request, int action, static int pakfire_request_add_archive(struct pakfire_request* request, int action, PakfireArchive archive, int extra_flags) { - PakfireRepo repo = pakfire_repo_create(request->pakfire, "@commandline"); + struct pakfire_repo* repo = pakfire_repo_create(request->pakfire, "@commandline"); if (!repo) return 1; diff --git a/src/libpakfire/snapshot.c b/src/libpakfire/snapshot.c index e6942d5b9..cd4f321a9 100644 --- a/src/libpakfire/snapshot.c +++ b/src/libpakfire/snapshot.c @@ -321,7 +321,7 @@ int pakfire_snapshot_restore(Pakfire pakfire, FILE* f) { if (r) return r; - PakfireRepo repo = pakfire_get_installed_repo(pakfire); + struct pakfire_repo* repo = pakfire_get_installed_repo(pakfire); if (!repo) goto ERROR; diff --git a/src/libpakfire/transaction.c b/src/libpakfire/transaction.c index 097800ca8..109b2e597 100644 --- a/src/libpakfire/transaction.c +++ b/src/libpakfire/transaction.c @@ -327,7 +327,7 @@ static void pakfire_transaction_add_line(char*** lines, size_t width, const char static void pakfire_transaction_add_package(char*** lines, size_t width, struct pakfire_package* pkg) { char size[128]; - PakfireRepo repo = pakfire_package_get_repo(pkg); + struct pakfire_repo* repo = pakfire_package_get_repo(pkg); // Format size pakfire_format_size(size, sizeof(size) - 1, pakfire_package_get_size(pkg)); @@ -920,7 +920,7 @@ static int pakfire_transaction_open_archives(struct pakfire_transaction* transac } static int pakfire_transaction_perform(struct pakfire_transaction* transaction) { - PakfireRepo repo = NULL; + struct pakfire_repo* repo = NULL; struct pakfire_db* db; int r; @@ -979,7 +979,7 @@ ERROR: static int pakfire_transaction_download_package(struct pakfire_transaction* transaction, struct pakfire_downloader* downloader, struct pakfire_package* pkg) { int r = 1; - PakfireRepo repo = NULL; + struct pakfire_repo* repo = NULL; struct pakfire_mirrorlist* mirrorlist = NULL; // Fetch the repository to download from diff --git a/tests/libpakfire/archive.c b/tests/libpakfire/archive.c index 4ec03a6af..eae7f612a 100644 --- a/tests/libpakfire/archive.c +++ b/tests/libpakfire/archive.c @@ -97,7 +97,7 @@ static int test_import(const struct test* t) { PakfireArchive archive; ASSERT_SUCCESS(pakfire_archive_open(&archive, t->pakfire, path)); - PakfireRepo repo = pakfire_repo_create(t->pakfire, "tmp"); + struct pakfire_repo* repo = pakfire_repo_create(t->pakfire, "tmp"); ASSERT(repo); struct pakfire_package* pkg = pakfire_repo_add_archive(repo, archive); diff --git a/tests/libpakfire/db.c b/tests/libpakfire/db.c index f51aabf92..921f6d377 100644 --- a/tests/libpakfire/db.c +++ b/tests/libpakfire/db.c @@ -65,7 +65,7 @@ static int test_check(const struct test* t) { static int test_add_package(const struct test* t) { struct pakfire_db* db; - PakfireRepo repo = pakfire_get_repo(t->pakfire, "@dummy"); + struct pakfire_repo* repo = pakfire_get_repo(t->pakfire, "@dummy"); ASSERT(repo); int r = pakfire_db_open(&db, t->pakfire, PAKFIRE_DB_READWRITE); diff --git a/tests/libpakfire/makefile.c b/tests/libpakfire/makefile.c index 324a5de65..d773cb844 100644 --- a/tests/libpakfire/makefile.c +++ b/tests/libpakfire/makefile.c @@ -95,7 +95,7 @@ static int test_macros(const struct test* t) { static int test_packages(const struct test* t) { struct pakfire_package* pkg = NULL; - PakfireRepo repo = pakfire_repo_create(t->pakfire, "test"); + struct pakfire_repo* repo = pakfire_repo_create(t->pakfire, "test"); ASSERT(repo); PakfireParser parser = pakfire_parser_create(t->pakfire, NULL, NULL, diff --git a/tests/libpakfire/packager.c b/tests/libpakfire/packager.c index 3771de44b..2a27c65c5 100644 --- a/tests/libpakfire/packager.c +++ b/tests/libpakfire/packager.c @@ -30,7 +30,7 @@ static int test_create(const struct test* t) { struct pakfire_packager* packager; - PakfireRepo repo = pakfire_repo_create(t->pakfire, "test"); + struct pakfire_repo* repo = pakfire_repo_create(t->pakfire, "test"); ASSERT(repo); struct pakfire_package* pkg = pakfire_package_create(t->pakfire, repo, diff --git a/tests/libpakfire/repo.c b/tests/libpakfire/repo.c index 0d38b1447..15ec307c7 100644 --- a/tests/libpakfire/repo.c +++ b/tests/libpakfire/repo.c @@ -27,7 +27,7 @@ static int test_scan(const struct test* t) { char baseurl[1024]; snprintf(baseurl, sizeof(baseurl) - 1, "file://%s/data", TEST_SRC_PATH); - PakfireRepo repo = pakfire_repo_create(t->pakfire, "test"); + struct pakfire_repo* repo = pakfire_repo_create(t->pakfire, "test"); ASSERT(repo); pakfire_repo_set_baseurl(repo, baseurl);