From: Michael Tremer Date: Fri, 27 Jun 2025 10:16:20 +0000 (+0000) Subject: pakfire: Rename pakfire_ctx() -> pakfire_get_ctx() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11d5cc9bb951881ceb94f5c836fe1b4e86d68a9f;p=pakfire.git pakfire: Rename pakfire_ctx() -> pakfire_get_ctx() Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/archive.c b/src/pakfire/archive.c index 8d21b28f..ec8806dd 100644 --- a/src/pakfire/archive.c +++ b/src/pakfire/archive.c @@ -705,7 +705,7 @@ int pakfire_archive_open(struct pakfire_archive** archive, return -errno; // Store a reference to the context - a->ctx = pakfire_ctx(pakfire); + a->ctx = pakfire_get_ctx(pakfire); // Store a reference to pakfire a->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/archive_writer.c b/src/pakfire/archive_writer.c index cb7c3c60..d90f096f 100644 --- a/src/pakfire/archive_writer.c +++ b/src/pakfire/archive_writer.c @@ -282,7 +282,7 @@ int pakfire_archive_writer_create(struct pakfire_archive_writer** writer, return -errno; // Store a reference to the context - self->ctx = pakfire_ctx(pakfire); + self->ctx = pakfire_get_ctx(pakfire); // Store a reference to Pakfire self->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/build.c b/src/pakfire/build.c index 6fca0b7e..70609e64 100644 --- a/src/pakfire/build.c +++ b/src/pakfire/build.c @@ -2824,7 +2824,7 @@ int pakfire_build_clean(struct pakfire* pakfire, int flags) { struct pakfire_repo* local = NULL; int r = 0; - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Fetch local repository local = pakfire_get_repo(pakfire, PAKFIRE_REPO_LOCAL); diff --git a/src/pakfire/db.c b/src/pakfire/db.c index b280a876..73ed487e 100644 --- a/src/pakfire/db.c +++ b/src/pakfire/db.c @@ -696,7 +696,7 @@ int pakfire_db_open(struct pakfire_db** db, struct pakfire* pakfire, int flags) return -errno; // Store a reference to the context - self->ctx = pakfire_ctx(pakfire); + self->ctx = pakfire_get_ctx(pakfire); // Store a reference to pakfire self->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/dist.c b/src/pakfire/dist.c index dd923bc8..1f8d9bec 100644 --- a/src/pakfire/dist.c +++ b/src/pakfire/dist.c @@ -154,7 +154,7 @@ int pakfire_read_makefile(struct pakfire_parser** parser, struct pakfire* pakfir int r; // Fetch context - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Create a new parser r = pakfire_parser_create(parser, pakfire, NULL, NULL, PAKFIRE_PARSER_FLAGS_EXPAND_COMMANDS); @@ -460,7 +460,7 @@ int pakfire_dist(struct pakfire* pakfire, int r; // Fetch context - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Load makefile r = pakfire_read_makefile(&makefile, pakfire, path, &error); diff --git a/src/pakfire/file.c b/src/pakfire/file.c index 5323e0c5..176fde31 100644 --- a/src/pakfire/file.c +++ b/src/pakfire/file.c @@ -388,7 +388,7 @@ int pakfire_file_create(struct pakfire_file** file, return -errno; // Store a reference to the context - f->ctx = pakfire_ctx(pakfire); + f->ctx = pakfire_get_ctx(pakfire); // Store reference to Pakfire f->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/filelist.c b/src/pakfire/filelist.c index dfc2a12c..f2e6011b 100644 --- a/src/pakfire/filelist.c +++ b/src/pakfire/filelist.c @@ -53,7 +53,7 @@ int pakfire_filelist_create(struct pakfire_filelist** list, struct pakfire* pakf return -errno; // Store a reference to the context - l->ctx = pakfire_ctx(pakfire); + l->ctx = pakfire_get_ctx(pakfire); // Store a reference to Pakfire l->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/jail.c b/src/pakfire/jail.c index fcf402f3..858593f6 100644 --- a/src/pakfire/jail.c +++ b/src/pakfire/jail.c @@ -213,7 +213,7 @@ int pakfire_jail_create(struct pakfire_jail** jail, struct pakfire* pakfire) { return -errno; // Reference context - self->ctx = pakfire_ctx(pakfire); + self->ctx = pakfire_get_ctx(pakfire); // Reference Pakfire self->pakfire = pakfire_ref(pakfire); @@ -2259,7 +2259,7 @@ static int pakfire_jail_run_if_possible(struct pakfire* pakfire, const char** ar int r; // Fetch the context - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); r = pakfire_path(pakfire, path, "%s", *argv); if (r) diff --git a/src/pakfire/linter.c b/src/pakfire/linter.c index 68902262..59cd49f4 100644 --- a/src/pakfire/linter.c +++ b/src/pakfire/linter.c @@ -179,7 +179,7 @@ int pakfire_linter_create(struct pakfire_linter** linter, return -errno; // Reference the context - l->ctx = pakfire_ctx(pakfire); + l->ctx = pakfire_get_ctx(pakfire); // Reference Pakfire l->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/oci.c b/src/pakfire/oci.c index 8985bb4b..659083bb 100644 --- a/src/pakfire/oci.c +++ b/src/pakfire/oci.c @@ -557,7 +557,7 @@ ERROR: int pakfire_oci_mkimage(struct pakfire* pakfire, FILE* f) { struct pakfire_oci_writer writer = { - .ctx = pakfire_ctx(pakfire), + .ctx = pakfire_get_ctx(pakfire), .pakfire = pakfire, }; int r; diff --git a/src/pakfire/package.c b/src/pakfire/package.c index 0b9107a1..78762864 100644 --- a/src/pakfire/package.c +++ b/src/pakfire/package.c @@ -177,7 +177,7 @@ int pakfire_package_create_from_solvable(struct pakfire_package** package, return -errno; // Store a reference to the context - pkg->ctx = pakfire_ctx(pakfire); + pkg->ctx = pakfire_get_ctx(pakfire); // Store a reference to Pakfire pkg->pakfire = pakfire_ref(pakfire); @@ -222,7 +222,7 @@ int pakfire_package_create(struct pakfire_package** package, } // Fetch the context - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Allocate a new solvable Id id = pakfire_repo_add_solvable(repo); diff --git a/src/pakfire/packager.c b/src/pakfire/packager.c index 65991a3e..5e9270ba 100644 --- a/src/pakfire/packager.c +++ b/src/pakfire/packager.c @@ -109,7 +109,7 @@ int pakfire_packager_create(struct pakfire_packager** packager, p->nrefs = 1; // Store a reference to the context - p->ctx = pakfire_ctx(pakfire); + p->ctx = pakfire_get_ctx(pakfire); // Store a reference to Pakfire p->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/pakfire.c b/src/pakfire/pakfire.c index 0892213d..4c50ce50 100644 --- a/src/pakfire/pakfire.c +++ b/src/pakfire/pakfire.c @@ -1185,7 +1185,7 @@ struct pakfire* pakfire_unref(struct pakfire* pakfire) { return NULL; } -struct pakfire_ctx* pakfire_ctx(struct pakfire* pakfire) { +struct pakfire_ctx* pakfire_get_ctx(struct pakfire* pakfire) { return pakfire_ctx_ref(pakfire->ctx); } diff --git a/src/pakfire/pakfire.h b/src/pakfire/pakfire.h index c15f54f8..cc1a8848 100644 --- a/src/pakfire/pakfire.h +++ b/src/pakfire/pakfire.h @@ -97,7 +97,7 @@ int pakfire_check(struct pakfire* pakfire, struct pakfire_filelist* errors); // Snapshots int pakfire_update_snapshot(struct pakfire* pakfire); -struct pakfire_ctx* pakfire_ctx(struct pakfire* pakfire); +struct pakfire_ctx* pakfire_get_ctx(struct pakfire* pakfire); const char* pakfire_get_effective_arch(struct pakfire* pakfire); diff --git a/src/pakfire/parser.c b/src/pakfire/parser.c index 4677016d..0e415590 100644 --- a/src/pakfire/parser.c +++ b/src/pakfire/parser.c @@ -105,7 +105,7 @@ int pakfire_parser_create(struct pakfire_parser** parser, return -errno; // Store a reference to the context - self->ctx = pakfire_ctx(pakfire); + self->ctx = pakfire_get_ctx(pakfire); // Store a reference to Pakfire self->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/parser/grammar.y b/src/pakfire/parser/grammar.y index 8f9c0be2..0fb2cf52 100644 --- a/src/pakfire/parser/grammar.y +++ b/src/pakfire/parser/grammar.y @@ -424,7 +424,7 @@ int pakfire_parser_parse_data(struct pakfire_parser* parent, const char* data, s }; // Fetch context - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); #ifdef ENABLE_DEBUG DEBUG(ctx, "Parsing the following data (%zu):\n%.*s\n", len, (int)len, data); diff --git a/src/pakfire/problem.c b/src/pakfire/problem.c index b4c44d86..39551ec9 100644 --- a/src/pakfire/problem.c +++ b/src/pakfire/problem.c @@ -200,7 +200,7 @@ int pakfire_problem_create(struct pakfire_problem** problem, return -errno; // Store a reference to the context - p->ctx = pakfire_ctx(pakfire); + p->ctx = pakfire_get_ctx(pakfire); // Store a reference to Pakfire p->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/pwd.c b/src/pakfire/pwd.c index ed58d859..65afbcf5 100644 --- a/src/pakfire/pwd.c +++ b/src/pakfire/pwd.c @@ -179,7 +179,7 @@ static int pakfire_getsubid(struct pakfire* pakfire, const char* owner, int count; int r = -1; - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); r = subid_init(PACKAGE_NAME, stderr); if (r) { @@ -227,7 +227,7 @@ static int pakfire_fgetsubid(struct pakfire* pakfire, struct pakfire_subid* subi size_t length = 0; char* p = NULL; - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Read the next line while (1) { @@ -308,7 +308,7 @@ static int pakfire_getsubid(struct pakfire* pakfire, const char* path, const cha if (!owner) return 1; - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); DEBUG(ctx, "Fetching SUBID from %s for %s\n", path, owner); diff --git a/src/pakfire/repo.c b/src/pakfire/repo.c index abf6b94c..3acaf328 100644 --- a/src/pakfire/repo.c +++ b/src/pakfire/repo.c @@ -1456,7 +1456,7 @@ int pakfire_repo_create(struct pakfire_repo** repo, return -errno; // Store a reference to the context - self->ctx = pakfire_ctx(pakfire); + self->ctx = pakfire_get_ctx(pakfire); // Store a reference to Pakfire self->pakfire = pakfire_ref(pakfire); @@ -1515,7 +1515,7 @@ int pakfire_repo_open(struct pakfire_repo** repo, struct pakfire* pakfire, Repo* return -errno; // Store a reference to the context - self->ctx = pakfire_ctx(pakfire); + self->ctx = pakfire_get_ctx(pakfire); // Store a reference to Pakfire self->pakfire = pakfire_ref(pakfire); @@ -2567,7 +2567,7 @@ int pakfire_repo_compose(struct pakfire* pakfire, const char* path, } // Fetch context - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // XXX Check if the key is a secret key diff --git a/src/pakfire/snapshot.c b/src/pakfire/snapshot.c index c5933063..69568e28 100644 --- a/src/pakfire/snapshot.c +++ b/src/pakfire/snapshot.c @@ -206,7 +206,7 @@ int pakfire_snapshot_find(struct pakfire_snapshot** snapshot, struct pakfire* pa int fd = -EBADF; int r; - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Make the path r = pakfire_cache_path(pakfire, path, "%s", "snapshots"); @@ -523,7 +523,7 @@ int pakfire_snapshot_make(struct pakfire_snapshot** snapshot, struct pakfire* pa NULL, }; - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Fetch the configuration config = pakfire_get_config(pakfire); @@ -609,7 +609,7 @@ int pakfire_snapshot_clean(struct pakfire* pakfire) { FTS* f = NULL; int r; - struct pakfire_ctx* ctx = pakfire_ctx(pakfire); + struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); DEBUG(ctx, "Cleaning up snapshots...\n"); diff --git a/src/pakfire/stripper.c b/src/pakfire/stripper.c index 14f6dd65..4c62742e 100644 --- a/src/pakfire/stripper.c +++ b/src/pakfire/stripper.c @@ -87,7 +87,7 @@ int pakfire_stripper_create(struct pakfire_stripper** stripper, return -errno; // Store a reference to the context - self->ctx = pakfire_ctx(pakfire); + self->ctx = pakfire_get_ctx(pakfire); // Store a reference to Pakfire self->pakfire = pakfire_ref(pakfire); diff --git a/src/pakfire/transaction.c b/src/pakfire/transaction.c index 70d259b3..7b746bb2 100644 --- a/src/pakfire/transaction.c +++ b/src/pakfire/transaction.c @@ -376,7 +376,7 @@ int pakfire_transaction_create(struct pakfire_transaction** transaction, return -errno; // Store a reference to the context - t->ctx = pakfire_ctx(pakfire); + t->ctx = pakfire_get_ctx(pakfire); // Store reference to Pakfire t->pakfire = pakfire_ref(pakfire);