]> git.ipfire.org Git - pakfire.git/commitdiff
repo: Change type from PakfireRepo to struct pakfire_repo
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 30 Jun 2021 18:07:38 +0000 (18:07 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 30 Jun 2021 18:07:38 +0000 (18:07 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
30 files changed:
src/_pakfire/archive.c
src/_pakfire/package.c
src/_pakfire/pakfire.c
src/_pakfire/repo.c
src/_pakfire/repo.h
src/libpakfire/archive.c
src/libpakfire/build.c
src/libpakfire/db.c
src/libpakfire/dist.c
src/libpakfire/include/pakfire/archive.h
src/libpakfire/include/pakfire/db.h
src/libpakfire/include/pakfire/package.h
src/libpakfire/include/pakfire/pakfire.h
src/libpakfire/include/pakfire/parser.h
src/libpakfire/include/pakfire/repo.h
src/libpakfire/include/pakfire/repolist.h
src/libpakfire/include/pakfire/types.h
src/libpakfire/package.c
src/libpakfire/pakfire.c
src/libpakfire/parser.c
src/libpakfire/repo.c
src/libpakfire/repolist.c
src/libpakfire/request.c
src/libpakfire/snapshot.c
src/libpakfire/transaction.c
tests/libpakfire/archive.c
tests/libpakfire/db.c
tests/libpakfire/makefile.c
tests/libpakfire/packager.c
tests/libpakfire/repo.c

index e4496b907e4a4ec4b3ea015ffb1529123f3642e4..6feb8d8c8db5cf6f96bd2879a57a0db675c87f7b 100644 (file)
@@ -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;
 
index f34ab766520fffe7d686dcba0218b82c669ffff0..abf75f3ab03ed37a5bdb476dab4a8a21b68bf231 100644 (file)
@@ -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;
 
index 2d1ea43c79f3f2def7baa9b424614a2cb6fa2eb6..666a6df1599cb3664ee03ee1dee5f9743e9cc5eb 100644 (file)
@@ -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;
 
index 8fe48581e46277c953f91bdbec838536339625c9..261b4ffb8ad3d9c80b13fb55aee70c3535f1985f 100644 (file)
@@ -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);
index b517a3e59f01a01b7a6b98cb5b55376912c66dfc..d6b6e0edec8157037de749eacdcd8e5e87210caf 100644 (file)
 
 #include <Python.h>
 
-#include <pakfire/types.h>
+#include <pakfire/repo.h>
 
 #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 */
index 375b34b33ecfbc089cc717b622952204f4612aed..b4176725ba9649baf93a00487a74f4ed246bad00 100644 (file)
@@ -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");
 
index b17bee95a2b3094a57dc90141b348d5e13f78ff6..192f4ba12434e78b91df1dc89fac86f929ef065b 100644 (file)
@@ -33,6 +33,7 @@
 #include <pakfire/packager.h>
 #include <pakfire/parser.h>
 #include <pakfire/private.h>
+#include <pakfire/repo.h>
 #include <pakfire/scriptlet.h>
 #include <pakfire/snapshot.h>
 #include <pakfire/types.h>
@@ -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);
index e9afcf92be624c12ddf6a15c90ea117ff3298e2c..2d5bb1a0788f4393d518e46e382c6d39b5a02317 100644 (file)
@@ -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;
 
index c0cc1ee250e7f3e5cccf688b2218dc50f80eb496..8948ce2b7726a37619eafe04ffa0125c6629d354 100644 (file)
@@ -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);
index a5ab3c2fdbe0627db192e2db58c2c0037413c294..a57fbf6e263bfecb171f126aed6248be948c9130 100644 (file)
@@ -24,6 +24,7 @@
 #include <stddef.h>
 
 #include <pakfire/package.h>
+#include <pakfire/repo.h>
 #include <pakfire/scriptlet.h>
 #include <pakfire/types.h>
 
@@ -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"
index 10f700c6f5848489da5b8e7dcf639d944ed52982..b978e8721acfc921543c648bc56b0a97ce9440af 100644 (file)
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 
 #include <pakfire/package.h>
+#include <pakfire/repo.h>
 #include <pakfire/scriptlet.h>
 #include <pakfire/types.h>
 
@@ -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);
index 31613fe804795c5f3fe4c76bdf98ab3ac66bd548..5d213a63ecc9976bbca5af89991ed2fc35151f96 100644 (file)
 
 #include <pakfire/filelist.h>
 #include <pakfire/packagelist.h>
+#include <pakfire/repo.h>
 #include <pakfire/types.h>
 
 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);
 
index 78d7983660791e4e5acae54471b6c3c754f1b02e..0151fc79f2656eaa0451378aa624d1a0a7bc9e70 100644 (file)
@@ -28,6 +28,7 @@
 #include <time.h>
 
 #include <pakfire/parser.h>
+#include <pakfire/repo.h>
 #include <pakfire/repolist.h>
 #include <pakfire/types.h>
 
@@ -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);
index 709f781a5277761d43aa1caf7fc17f53b25843a1..dd92d1750f7e285e114f7b9c9084672ce2d2cc02 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdio.h>
 
 #include <pakfire/package.h>
+#include <pakfire/repo.h>
 #include <pakfire/types.h>
 
 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,
index b7c8018a1450632b93331400e50cf18a349fc51a..67ec53cb4483c921af98bcd7f1c479ab076e451a 100644 (file)
 #include <time.h>
 #include <unistd.h>
 
+struct pakfire_repo;
+
 #include <pakfire/package.h>
 #include <pakfire/types.h>
 
-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 <pakfire/downloader.h>
 
 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
 
index 528ca8c092cf62512272f9347af0884ccc5fcbca..3f47b60aaa83ba153c4fe0d0fa55fea7c7e2c578 100644 (file)
@@ -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 */
index d36212cf9a12953e1f533faecc6f2cf759a9374a..599a00e9807c70ace64ea862da846ac27a971bfa 100644 (file)
@@ -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 */
index 954ac84a52f62d9e1cb81f4b189081eb595566a2..c016cf89961e18b291a630681d752ead8404c40b 100644 (file)
@@ -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);
 
index c7e89b5b4cfac449abf60bc9fb74e6d8ec5b90ce..295a1fdcbb16d85e8202f04a84a155d431f665f5 100644 (file)
@@ -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;
 
index fa4c74f3d5e2b7a9d403ce1a6184473286b390d0..7d1020b7efb66b679fc869d84572053178116a84 100644 (file)
@@ -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;
index 8b90d55ef1c236ab10a70c3e93a9d0abbfb69beb..046197e02b2daff15d40c0b1ea812c8af38b4124 100644 (file)
@@ -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;
 
index d215d7340968165cc2612322e924c4f7ede33d49..96e417372635274d03cf727494c50bf13b5c495e 100644 (file)
 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;
 
index 19d3f3f4c88b5cebdc3883b22d762f01e7460c53..6767ca7038cb0cac81a68ed8195dafe10f1fccc5 100644 (file)
@@ -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;
 
index e6942d5b924ad43a6b8fb5414f355a639279423a..cd4f321a9e0bf540ceed087ac376ced1e58fe676 100644 (file)
@@ -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;
 
index 097800ca887ae4a9dd5c6183296f2ae71dfa40d4..109b2e59733fe22d465b3a94a033eec884cdab8f 100644 (file)
@@ -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
index 4ec03a6af4b48823778d92e8744edd0e1f6f1909..eae7f612aed7d7d5a11553ffcc2f12ab5a9db8c8 100644 (file)
@@ -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);
index f51aabf92cdb5359898a50ceaca253151ca106ed..921f6d3774fbbe4ce46a21a4c61b617d8e2a40f6 100644 (file)
@@ -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);
index 324a5de654f9ae0eaef26a9973fdc5be97d2bd92..d773cb844cd2e05ee7bcbbcfd4f6ab45c756f891 100644 (file)
@@ -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,
index 3771de44bdfc41b51cddb0cc51a2b0d1ee4904d4..2a27c65c51bd99c8de806cf6a5747de801f159e6 100644 (file)
@@ -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,
index 0d38b1447525ed308febd522d56d781ea061a5c4..15ec307c735cbabd4e8c77b3ac55cb711ef8a4ae 100644 (file)
@@ -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);