From: Michael Tremer Date: Fri, 27 Jun 2025 10:20:11 +0000 (+0000) Subject: ctx: Create a new type for the context X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=27886789907c01b785c0e37e8763bc75988906ff;p=pakfire.git ctx: Create a new type for the context Signed-off-by: Michael Tremer --- diff --git a/src/cli/lib/build.c b/src/cli/lib/build.c index 64ce2a399..d1f88b461 100644 --- a/src/cli/lib/build.c +++ b/src/cli/lib/build.c @@ -162,7 +162,7 @@ static void log_callback(void* data, int priority, const char* file, int line, free(buffer); } -static int result_callback(struct pakfire_ctx* ctx, struct pakfire* pakfire, +static int result_callback(pakfire_ctx* ctx, struct pakfire* pakfire, struct pakfire_build* build, struct pakfire_archive* archive, void* data) { const struct cli_local_args* local_args = data; struct pakfire_package* pkg = NULL; diff --git a/src/cli/lib/config.c b/src/cli/lib/config.c index 83fa22019..d2c106322 100644 --- a/src/cli/lib/config.c +++ b/src/cli/lib/config.c @@ -24,7 +24,7 @@ #include "config.h" -const char* cli_get_default_distro(struct pakfire_ctx* ctx) { +const char* cli_get_default_distro(pakfire_ctx* ctx) { struct pakfire_config* config = NULL; const char* distro = NULL; diff --git a/src/cli/lib/config.h b/src/cli/lib/config.h index b74dec244..dbeba3185 100644 --- a/src/cli/lib/config.h +++ b/src/cli/lib/config.h @@ -24,7 +24,7 @@ #include #include -const char* cli_get_default_distro(struct pakfire_ctx* ctx); +const char* cli_get_default_distro(pakfire_ctx* ctx); int cli_read_distro_config(struct pakfire_config* config, const char* distro); diff --git a/src/cli/lib/daemon.c b/src/cli/lib/daemon.c index a72748608..e0894f5bb 100644 --- a/src/cli/lib/daemon.c +++ b/src/cli/lib/daemon.c @@ -23,7 +23,7 @@ #include "daemon.h" -int cli_daemon_main(struct pakfire_ctx* ctx) { +int cli_daemon_main(pakfire_ctx* ctx) { struct pakfire_daemon* daemon = NULL; int r; diff --git a/src/cli/lib/daemon.h b/src/cli/lib/daemon.h index 736c7625a..566fafa9d 100644 --- a/src/cli/lib/daemon.h +++ b/src/cli/lib/daemon.h @@ -23,6 +23,6 @@ #include -int cli_daemon_main(struct pakfire_ctx* ctx); +int cli_daemon_main(pakfire_ctx* ctx); #endif /* PAKFIRE_CLI_DAEMON_H */ diff --git a/src/cli/lib/dump.c b/src/cli/lib/dump.c index 2037f92d5..7055361dd 100644 --- a/src/cli/lib/dump.c +++ b/src/cli/lib/dump.c @@ -48,7 +48,7 @@ int cli_dump_package(struct pakfire_package* package, int flags) { return 0; } -static int __cli_dump_package(struct pakfire_ctx* ctx, struct pakfire_package* package, void* p) { +static int __cli_dump_package(pakfire_ctx* ctx, struct pakfire_package* package, void* p) { int flags = *(int*)p; #if 0 diff --git a/src/cli/lib/lint.c b/src/cli/lib/lint.c index 03b211e49..c20bcf4d7 100644 --- a/src/cli/lib/lint.c +++ b/src/cli/lib/lint.c @@ -60,7 +60,7 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) { return 0; } -static int cli_linter_result(struct pakfire_ctx* ctx, struct pakfire_archive* archive, +static int cli_linter_result(pakfire_ctx* ctx, struct pakfire_archive* archive, struct pakfire_package* package, struct pakfire_file* file, int priority, const char* result, void* data) { const char* nevra = pakfire_package_get_string(package, PAKFIRE_PKG_NEVRA); diff --git a/src/cli/lib/pakfire.h b/src/cli/lib/pakfire.h index dd5dc1c3b..8a2230fc4 100644 --- a/src/cli/lib/pakfire.h +++ b/src/cli/lib/pakfire.h @@ -30,7 +30,7 @@ #define MAX_REPOS 16 struct cli_global_args { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; const char* distro; const char* config; diff --git a/src/cli/lib/progressbar.c b/src/cli/lib/progressbar.c index c28d0d813..3946fb412 100644 --- a/src/cli/lib/progressbar.c +++ b/src/cli/lib/progressbar.c @@ -129,7 +129,7 @@ static void cli_progressbar_free(struct cli_progressbar* p) { free(p); } -static void __cli_progressbar_free(struct pakfire_ctx* ctx, +static void __cli_progressbar_free(pakfire_ctx* ctx, struct pakfire_progress* progress, void* data) { struct cli_progressbar* progressbar = data; @@ -238,7 +238,7 @@ ERROR: return (void *)(intptr_t)r; } -static int cli_progressbar_start(struct pakfire_ctx* ctx, struct pakfire_progress* progress, +static int cli_progressbar_start(pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, unsigned long int max_value) { struct cli_progressbar* progressbar = data; @@ -249,7 +249,7 @@ static int cli_progressbar_start(struct pakfire_ctx* ctx, struct pakfire_progres return pthread_create(&progressbar->renderer, NULL, cli_progressbar_renderer, progressbar); } -static int cli_progressbar_finish(struct pakfire_ctx* ctx, struct pakfire_progress* progress, +static int cli_progressbar_finish(pakfire_ctx* ctx, struct pakfire_progress* progress, void* data) { struct cli_progressbar* progressbar = data; void* retval = NULL; @@ -488,7 +488,7 @@ static int cli_progressbar_add_transfer_speed(struct cli_progressbar* p) { return cli_progressbar_add_widget(p, cli_progressbar_transfer_speed, NULL, 0, NULL); } -int cli_setup_progressbar(struct pakfire_ctx* ctx, void* data, struct pakfire_progress* p) { +int cli_setup_progressbar(pakfire_ctx* ctx, void* data, struct pakfire_progress* p) { struct cli_progressbar* progressbar = NULL; int r; diff --git a/src/cli/lib/progressbar.h b/src/cli/lib/progressbar.h index ff7aa493f..74ee6559a 100644 --- a/src/cli/lib/progressbar.h +++ b/src/cli/lib/progressbar.h @@ -24,6 +24,6 @@ #include #include -int cli_setup_progressbar(struct pakfire_ctx* ctx, void* data, struct pakfire_progress* p); +int cli_setup_progressbar(pakfire_ctx* ctx, void* data, struct pakfire_progress* p); #endif /* PAKFIRE_CLI_PROGRESSBAR_H */ diff --git a/src/cli/lib/repo_compose.c b/src/cli/lib/repo_compose.c index 3a87b41dd..f481da4ea 100644 --- a/src/cli/lib/repo_compose.c +++ b/src/cli/lib/repo_compose.c @@ -77,7 +77,7 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) { } static int cli_import_key(struct pakfire_key** key, - struct pakfire_ctx* ctx, const char* path) { + pakfire_ctx* ctx, const char* path) { FILE* f = NULL; int r; diff --git a/src/cli/lib/terminal.c b/src/cli/lib/terminal.c index e32aa6701..a4cda59f5 100644 --- a/src/cli/lib/terminal.c +++ b/src/cli/lib/terminal.c @@ -85,7 +85,7 @@ int cli_term_is_interactive(void) { return isatty(STDIN_FILENO) && isatty(STDOUT_FILENO) && isatty(STDERR_FILENO); } -int cli_term_confirm(struct pakfire_ctx* ctx, struct pakfire* pakfire, +int cli_term_confirm(pakfire_ctx* ctx, struct pakfire* pakfire, void* data, const char* message, const char* question) { char* line = NULL; size_t length = 0; @@ -140,7 +140,7 @@ END: return r; } -int cli_term_confirm_yes(struct pakfire_ctx* ctx, struct pakfire* pakfire, +int cli_term_confirm_yes(pakfire_ctx* ctx, struct pakfire* pakfire, void* data, const char* message, const char* question) { return 0; } @@ -256,7 +256,7 @@ static struct pakfire_solution* cli_term_find_solution( return selected_solution; } -int cli_term_pick_solution(struct pakfire_ctx* ctx, struct pakfire* pakfire, void* data, +int cli_term_pick_solution(pakfire_ctx* ctx, struct pakfire* pakfire, void* data, struct pakfire_transaction* transaction) { struct pakfire_problem** problems = NULL; struct pakfire_solution* solution = NULL; diff --git a/src/cli/lib/terminal.h b/src/cli/lib/terminal.h index 2f6c09672..a34c7d9bd 100644 --- a/src/cli/lib/terminal.h +++ b/src/cli/lib/terminal.h @@ -29,12 +29,12 @@ int cli_term_get_dimensions(int* rows, int* cols); int cli_term_is_interactive(void); -int cli_term_confirm(struct pakfire_ctx* ctx, struct pakfire* pakfire, +int cli_term_confirm(pakfire_ctx* ctx, struct pakfire* pakfire, void* data, const char* message, const char* question); -int cli_term_confirm_yes(struct pakfire_ctx* ctx, struct pakfire* pakfire, +int cli_term_confirm_yes(pakfire_ctx* ctx, struct pakfire* pakfire, void* data, const char* message, const char* question); -int cli_term_pick_solution(struct pakfire_ctx* ctx, struct pakfire* pakfire, +int cli_term_pick_solution(pakfire_ctx* ctx, struct pakfire* pakfire, void* data, struct pakfire_transaction* transaction); #endif /* PAKFIRE_CLI_TERMINAL_H */ diff --git a/src/cli/pakfire-builder.c b/src/cli/pakfire-builder.c index 859a588c7..199f3b2d9 100644 --- a/src/cli/pakfire-builder.c +++ b/src/cli/pakfire-builder.c @@ -144,7 +144,7 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) { return 0; } -static int cli_confirm(struct pakfire_ctx* ctx, struct pakfire* pakfire, +static int cli_confirm(pakfire_ctx* ctx, struct pakfire* pakfire, void* data, const char* message, const char* question) { // Just print the message if (message) @@ -154,7 +154,7 @@ static int cli_confirm(struct pakfire_ctx* ctx, struct pakfire* pakfire, } int main(int argc, char* argv[]) { - struct pakfire_ctx* ctx = NULL; + pakfire_ctx* ctx = NULL; int r; // Setup the context diff --git a/src/cli/pakfire-client.c b/src/cli/pakfire-client.c index 9899fff20..0ca8a3b0d 100644 --- a/src/cli/pakfire-client.c +++ b/src/cli/pakfire-client.c @@ -80,7 +80,7 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) { } int main(int argc, char* argv[]) { - struct pakfire_ctx* ctx = NULL; + pakfire_ctx* ctx = NULL; int r; // Setup the context diff --git a/src/cli/pakfire-daemon.c b/src/cli/pakfire-daemon.c index c8072b73c..17a1ce1db 100644 --- a/src/cli/pakfire-daemon.c +++ b/src/cli/pakfire-daemon.c @@ -43,7 +43,7 @@ static struct argp_option options[] = { }; static error_t parse(int key, char* arg, struct argp_state* state, void* data) { - struct pakfire_ctx* ctx = data; + pakfire_ctx* ctx = data; switch (key) { case OPT_DEBUG: @@ -62,7 +62,7 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) { } int main(int argc, char* argv[]) { - struct pakfire_ctx* ctx = NULL; + pakfire_ctx* ctx = NULL; int r; // Initialize changing the process title diff --git a/src/cli/pakfire.c b/src/cli/pakfire.c index f0c92b0bc..4945e108d 100644 --- a/src/cli/pakfire.c +++ b/src/cli/pakfire.c @@ -137,7 +137,7 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) { int main(int argc, char* argv[]) { - struct pakfire_ctx* ctx = NULL; + pakfire_ctx* ctx = NULL; int r; // Setup the context diff --git a/src/pakfire/archive.c b/src/pakfire/archive.c index ec8806dd1..9cc499e08 100644 --- a/src/pakfire/archive.c +++ b/src/pakfire/archive.c @@ -66,7 +66,7 @@ #define ARCHIVE_READ_BLOCK_SIZE 512 * 1024 struct pakfire_archive { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; @@ -1924,7 +1924,7 @@ static int pakfire_archive_filter_systemd_sysusers(struct pakfire_archive* archi } static ssize_t pakfire_archive_stream_payload( - struct pakfire_ctx* ctx, void* data, char* buffer, size_t length) { + pakfire_ctx* ctx, void* data, char* buffer, size_t length) { struct archive* a = data; ssize_t bytes_read; diff --git a/src/pakfire/archive_writer.c b/src/pakfire/archive_writer.c index d90f096ff..b5a6ad25a 100644 --- a/src/pakfire/archive_writer.c +++ b/src/pakfire/archive_writer.c @@ -38,7 +38,7 @@ #include struct pakfire_archive_writer { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Pakfire @@ -454,7 +454,7 @@ ERROR: } static int pakfire_archive_writer_write_file( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_archive_writer* self = data; struct archive_entry* sparse_entry = NULL; struct archive_entry* entry = NULL; diff --git a/src/pakfire/buffer.c b/src/pakfire/buffer.c index c70f60ebb..4e05752e0 100644 --- a/src/pakfire/buffer.c +++ b/src/pakfire/buffer.c @@ -206,7 +206,7 @@ int pakfire_buffer_write(struct pakfire_buffer* self, int fd) { } int pakfire_buffer_fill(struct pakfire_buffer* self, - struct pakfire_ctx* ctx, pakfire_buffer_input_callback callback, void* data) { + pakfire_ctx* ctx, pakfire_buffer_input_callback callback, void* data) { ssize_t bytes_written = 0; int r; diff --git a/src/pakfire/buffer.h b/src/pakfire/buffer.h index 5ab14bb89..826ba11ad 100644 --- a/src/pakfire/buffer.h +++ b/src/pakfire/buffer.h @@ -24,7 +24,7 @@ #include typedef ssize_t (*pakfire_buffer_input_callback) - (struct pakfire_ctx* ctx, void* data, char* buffer, size_t length); + (pakfire_ctx* ctx, void* data, char* buffer, size_t length); struct pakfire_buffer { char* data; @@ -55,7 +55,7 @@ int pakfire_buffer_read(struct pakfire_buffer* self, int fd); int pakfire_buffer_write(struct pakfire_buffer* self, int fd); int pakfire_buffer_fill(struct pakfire_buffer* self, - struct pakfire_ctx* ctx, pakfire_buffer_input_callback callback, void* data); + pakfire_ctx* ctx, pakfire_buffer_input_callback callback, void* data); size_t pakfire_buffer_find_line(struct pakfire_buffer* self); diff --git a/src/pakfire/build.c b/src/pakfire/build.c index 70609e640..edbd8ab45 100644 --- a/src/pakfire/build.c +++ b/src/pakfire/build.c @@ -67,7 +67,7 @@ static const char* PAKFIRE_BUILD_PACKAGES[] = { }; struct pakfire_build { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; @@ -126,7 +126,7 @@ static double pakfire_build_duration(struct pakfire_build* build) { return pakfire_timespec_delta(&now, &build->time_start); } -static int pakfire_build_output_callback(struct pakfire_ctx* ctx, void* data, +static int pakfire_build_output_callback(pakfire_ctx* ctx, void* data, const enum pakfire_jail_output_stream stream, const char* line, size_t length) { struct pakfire_build* build = data; @@ -375,7 +375,7 @@ static int pakfire_build_process_pkgconfig_dep(struct pakfire_package* pkg, return 0; } -static int pakfire_build_process_pkgconfig_provides(struct pakfire_ctx* ctx, void* data, +static int pakfire_build_process_pkgconfig_provides(pakfire_ctx* ctx, void* data, const enum pakfire_jail_output_stream stream, const char* line, const size_t length) { struct pakfire_find_deps_ctx* deps = data; struct pakfire_build* self = deps->build; @@ -394,7 +394,7 @@ static int pakfire_build_process_pkgconfig_provides(struct pakfire_ctx* ctx, voi return 0; } -static int pakfire_build_process_pkgconfig_requires(struct pakfire_ctx* ctx, void* data, +static int pakfire_build_process_pkgconfig_requires(pakfire_ctx* ctx, void* data, const enum pakfire_jail_output_stream stream, const char* line, const size_t length) { struct pakfire_find_deps_ctx* deps = data; struct pakfire_build* self = deps->build; @@ -414,7 +414,7 @@ static int pakfire_build_process_pkgconfig_requires(struct pakfire_ctx* ctx, voi } static int pakfire_build_find_pkgconfig_provides( - struct pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { + pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { int r; // Fetch the absolute path @@ -439,7 +439,7 @@ static int pakfire_build_find_pkgconfig_provides( } static int pakfire_build_find_pkgconfig_requires( - struct pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { + pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { struct pakfire_env* env = NULL; int r; @@ -494,7 +494,7 @@ ERROR: } static int pakfire_build_find_elf_provides( - struct pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { + pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { struct pakfire_elf* elf = NULL; char** provides = NULL; int r; @@ -545,7 +545,7 @@ ERROR: } static int pakfire_build_find_elf_requires( - struct pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { + pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { struct pakfire_elf* elf = NULL; char** requires = NULL; int r; @@ -600,7 +600,7 @@ ERROR: } static int pakfire_build_find_python_abi_requires( - struct pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { + pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { char basename[PATH_MAX]; const char* p = NULL; int r; @@ -631,7 +631,7 @@ static int pakfire_build_find_python_abi_requires( } static int pakfire_build_find_symlink_destinations( - struct pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { + pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { const char* symlink = NULL; const char* path = NULL; char buffer[PATH_MAX]; @@ -661,7 +661,7 @@ static int pakfire_build_find_symlink_destinations( } static int pakfire_build_find_provides( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_find_deps_ctx* deps = data; int r; @@ -692,7 +692,7 @@ static int pakfire_build_find_provides( } static int pakfire_build_find_requires( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_find_deps_ctx* deps = data; int r; @@ -744,7 +744,7 @@ static int pakfire_build_find_requires( */ static int pakfire_build_find_perl_files( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_filelist* perlfiles = data; // Add all perl files @@ -754,13 +754,13 @@ static int pakfire_build_find_perl_files( return 0; } -static int pakfire_build_add_perl_dep(struct pakfire_ctx* ctx, struct pakfire_package* pkg, +static int pakfire_build_add_perl_dep(pakfire_ctx* ctx, struct pakfire_package* pkg, const enum pakfire_package_key key, const char* line, size_t length) { // Add the dependency return pakfire_package_add_dep(pkg, key, "%.*s", (int)length, line); } -static int pakfire_build_add_perl_provides(struct pakfire_ctx* ctx, void* data, +static int pakfire_build_add_perl_provides(pakfire_ctx* ctx, void* data, const enum pakfire_jail_output_stream stream, const char* line, size_t length) { struct pakfire_package* pkg = data; @@ -778,7 +778,7 @@ static int pakfire_build_add_perl_provides(struct pakfire_ctx* ctx, void* data, return 0; } -static int pakfire_build_add_perl_requires(struct pakfire_ctx* ctx, void* data, +static int pakfire_build_add_perl_requires(pakfire_ctx* ctx, void* data, const enum pakfire_jail_output_stream stream, const char* line, size_t length) { struct pakfire_package* pkg = data; @@ -901,7 +901,7 @@ ERROR: } static int __pakfire_build_package_mark_config_files( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { char** configfiles = data; int r; @@ -1053,7 +1053,7 @@ static int pakfire_build_extract_command( return __pakfire_string_setn(command, lcommand, s, l); } -static int pakfire_build_process_scriptlet_dep(struct pakfire_ctx* ctx, void* data, +static int pakfire_build_process_scriptlet_dep(pakfire_ctx* ctx, void* data, const enum pakfire_jail_output_stream stream, const char* line, const size_t length) { struct pakfire_find_deps_ctx* deps = data; struct pakfire_build* self = deps->build; @@ -1320,7 +1320,7 @@ ERROR: return r; } -static int pakfire_build_package_dump(struct pakfire_ctx* ctx, +static int pakfire_build_package_dump(pakfire_ctx* ctx, struct pakfire_package* pkg, void* p) { struct pakfire_build* build = p; @@ -1505,7 +1505,7 @@ ERROR: } static int __pakfire_build_remove_static_libraries( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { const struct pakfire_build_post_process_state* state = data; char path[PATH_MAX]; int r; @@ -1539,7 +1539,7 @@ static int pakfire_build_post_remove_static_libraries( } static int __pakfire_build_remove_libtool_archives( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { const struct pakfire_build_post_process_state* state = data; // Find all libtool archive files @@ -1558,7 +1558,7 @@ static int pakfire_build_post_remove_libtool_archives( } static int __pakfire_build_check_broken_symlinks( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { const struct pakfire_build_post_process_state* state = data; int r; @@ -1590,7 +1590,7 @@ static int pakfire_build_post_check_broken_symlinks( } static int pakfire_build_fix_script_interpreter( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { // Only run this for regular files switch (pakfire_file_get_type(file)) { case S_IFREG: @@ -1614,7 +1614,7 @@ static int pakfire_build_fix_script_interpreter( } static int pakfire_build_check_buildroot( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { const struct pakfire_build_post_process_state* state = data; int r; @@ -2090,7 +2090,7 @@ static int pakfire_build_setup_buildroot(struct pakfire_build* build) { return 0; } -int pakfire_build_create(struct pakfire_build** build, struct pakfire_ctx* ctx, +int pakfire_build_create(struct pakfire_build** build, pakfire_ctx* ctx, struct pakfire_config* config, const char* arch, const char* id, int flags) { int r; @@ -2292,7 +2292,7 @@ ERROR: } static int __pakfire_build_unpackaged_file( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* p) { + pakfire_ctx* ctx, struct pakfire_file* file, void* p) { char* s = pakfire_file_dump(file, PAKFIRE_FILE_DUMP_FULL); if (s) { ERROR(ctx, "%s\n", s); @@ -2334,7 +2334,7 @@ ERROR: return r; } -static int pakfire_build_install_package(struct pakfire_ctx* ctx, +static int pakfire_build_install_package(pakfire_ctx* ctx, struct pakfire_package* pkg, void* p) { struct pakfire_transaction* transaction = (struct pakfire_transaction*)p; @@ -2468,7 +2468,7 @@ ERROR: } static int pakfire_build_lint_archive( - struct pakfire_ctx* ctx, struct pakfire_package* pkg, struct pakfire_archive* archive, void* data) { + pakfire_ctx* ctx, struct pakfire_package* pkg, struct pakfire_archive* archive, void* data) { return pakfire_archive_lint(archive, NULL, NULL); } @@ -2493,7 +2493,7 @@ struct pakfire_build_result { void* data; }; -static int pakfire_build_result(struct pakfire_ctx* ctx, struct pakfire_package* pkg, +static int pakfire_build_result(pakfire_ctx* ctx, struct pakfire_package* pkg, struct pakfire_archive* archive, void* data) { const struct pakfire_build_result* result = data; struct pakfire_build* build = result->build; @@ -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_get_ctx(pakfire); + pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Fetch local repository local = pakfire_get_repo(pakfire, PAKFIRE_REPO_LOCAL); diff --git a/src/pakfire/build.h b/src/pakfire/build.h index 4194ee48d..8d77801e6 100644 --- a/src/pakfire/build.h +++ b/src/pakfire/build.h @@ -35,10 +35,10 @@ enum pakfire_build_flags { PAKFIRE_BUILD_LOCAL = (1 << 4), }; -typedef int (*pakfire_build_result_callback)(struct pakfire_ctx* ctx, struct pakfire* pakfire, +typedef int (*pakfire_build_result_callback)(pakfire_ctx* ctx, struct pakfire* pakfire, struct pakfire_build* build, struct pakfire_archive* archive, void* data); -int pakfire_build_create(struct pakfire_build** build, struct pakfire_ctx* ctx, +int pakfire_build_create(struct pakfire_build** build, pakfire_ctx* ctx, struct pakfire_config* config, const char* arch, const char* id, int flags); struct pakfire_build* pakfire_build_ref(struct pakfire_build* build); diff --git a/src/pakfire/builder.c b/src/pakfire/builder.c index 2402432b5..4fd3eddc6 100644 --- a/src/pakfire/builder.c +++ b/src/pakfire/builder.c @@ -39,7 +39,7 @@ struct pakfire_builder { // Context - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; // Reference Counter int nrefs; @@ -82,7 +82,7 @@ static void pakfire_builder_free(struct pakfire_builder* self) { } int pakfire_builder_create(struct pakfire_builder** builder, - struct pakfire_ctx* ctx, struct pakfire_client* client) { + pakfire_ctx* ctx, struct pakfire_client* client) { struct pakfire_builder* self = NULL; int r; diff --git a/src/pakfire/builder.h b/src/pakfire/builder.h index d43a323ba..05e86ea9f 100644 --- a/src/pakfire/builder.h +++ b/src/pakfire/builder.h @@ -32,7 +32,7 @@ struct pakfire_builder; #include int pakfire_builder_create(struct pakfire_builder** builder, - struct pakfire_ctx* ctx, struct pakfire_client* client); + pakfire_ctx* ctx, struct pakfire_client* client); struct pakfire_builder* pakfire_builder_ref(struct pakfire_builder* self); struct pakfire_builder* pakfire_builder_unref(struct pakfire_builder* self); diff --git a/src/pakfire/cgroup.c b/src/pakfire/cgroup.c index 8f9d61cab..4c7280e47 100644 --- a/src/pakfire/cgroup.c +++ b/src/pakfire/cgroup.c @@ -59,7 +59,7 @@ }) struct pakfire_cgroup { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // The parent group @@ -358,7 +358,7 @@ static int pakfire_cgroup_enable_controller(struct pakfire_cgroup* cgroup, int c If the cgroup doesn't exist, it will be created including any parent cgroups. */ static int pakfire_cgroup_open(struct pakfire_cgroup** cgroup, - struct pakfire_ctx* ctx, struct pakfire_cgroup* parent, const char* name, int flags) { + pakfire_ctx* ctx, struct pakfire_cgroup* parent, const char* name, int flags) { struct pakfire_cgroup* c = NULL; int r; @@ -427,7 +427,7 @@ ERROR: } static int pakfire_cgroup_create_recursive(struct pakfire_cgroup** cgroup, - struct pakfire_ctx* ctx, struct pakfire_cgroup* parent, const char* name, int flags) { + pakfire_ctx* ctx, struct pakfire_cgroup* parent, const char* name, int flags) { struct pakfire_cgroup* child = NULL; char buffer[NAME_MAX]; char* p = NULL; @@ -469,7 +469,7 @@ ERROR: } int pakfire_cgroup_create(struct pakfire_cgroup** cgroup, - struct pakfire_ctx* ctx, struct pakfire_cgroup* parent, const char* name, int flags) { + pakfire_ctx* ctx, struct pakfire_cgroup* parent, const char* name, int flags) { struct pakfire_cgroup* root = NULL; int r; diff --git a/src/pakfire/cgroup.h b/src/pakfire/cgroup.h index 37c8863bd..0cfd47895 100644 --- a/src/pakfire/cgroup.h +++ b/src/pakfire/cgroup.h @@ -201,7 +201,7 @@ struct pakfire_cgroup_stats { }; int pakfire_cgroup_create(struct pakfire_cgroup** cgroup, - struct pakfire_ctx* ctx, struct pakfire_cgroup* parent, const char* name, int flags); + pakfire_ctx* ctx, struct pakfire_cgroup* parent, const char* name, int flags); struct pakfire_cgroup* pakfire_cgroup_ref(struct pakfire_cgroup* cgroup); struct pakfire_cgroup* pakfire_cgroup_unref(struct pakfire_cgroup* cgroup); diff --git a/src/pakfire/client.c b/src/pakfire/client.c index cb4fba0e7..ddc53877b 100644 --- a/src/pakfire/client.c +++ b/src/pakfire/client.c @@ -72,7 +72,7 @@ struct pakfire_client_upload { }; struct pakfire_client { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Event Loop @@ -501,7 +501,7 @@ static void pakfire_client_free(struct pakfire_client* self) { } int pakfire_client_create(struct pakfire_client** client, - struct pakfire_ctx* ctx, const char* url, const char* principal) { + pakfire_ctx* ctx, const char* url, const char* principal) { struct pakfire_client* self = NULL; char hostname[HOST_NAME_MAX]; int r; diff --git a/src/pakfire/client.h b/src/pakfire/client.h index c8effeba1..ec4d073c1 100644 --- a/src/pakfire/client.h +++ b/src/pakfire/client.h @@ -31,7 +31,7 @@ struct pakfire_client; #include int pakfire_client_create(struct pakfire_client** client, - struct pakfire_ctx* ctx, const char* url, const char* principal); + pakfire_ctx* ctx, const char* url, const char* principal); struct pakfire_client* pakfire_client_ref(struct pakfire_client* client); struct pakfire_client* pakfire_client_unref(struct pakfire_client* client); diff --git a/src/pakfire/ctx.c b/src/pakfire/ctx.c index 8e20f0ee4..ceee07a2f 100644 --- a/src/pakfire/ctx.c +++ b/src/pakfire/ctx.c @@ -124,7 +124,7 @@ static int parse_log_level(const char* level) { return 0; } -static int pakfire_ctx_setup_logging(struct pakfire_ctx* self) { +static int pakfire_ctx_setup_logging(pakfire_ctx* self) { const char* env = NULL; // Set the default level to INFO @@ -144,7 +144,7 @@ static int pakfire_ctx_setup_logging(struct pakfire_ctx* self) { return 0; } -static int pakfire_ctx_default_confirm_callback(struct pakfire_ctx* self, +static int pakfire_ctx_default_confirm_callback(pakfire_ctx* self, struct pakfire* pakfire, void* data, const char* message, const char* question) { // Just log the message INFO(self, "%s\n", message); @@ -152,7 +152,7 @@ static int pakfire_ctx_default_confirm_callback(struct pakfire_ctx* self, return 0; } -static int pakfire_ctx_load_config(struct pakfire_ctx* self, const char* path) { +static int pakfire_ctx_load_config(pakfire_ctx* self, const char* path) { FILE* f = NULL; int r; @@ -182,7 +182,7 @@ static int pakfire_ctx_load_config(struct pakfire_ctx* self, const char* path) { return r; } -static void pakfire_ctx_free(struct pakfire_ctx* self) { +static void pakfire_ctx_free(pakfire_ctx* self) { // Release the events if (self->events.loop_started) sd_event_source_unref(self->events.loop_started); @@ -206,8 +206,8 @@ static void pakfire_ctx_free(struct pakfire_ctx* self) { free(self); } -int pakfire_ctx_create(struct pakfire_ctx** ctx, const char* path) { - struct pakfire_ctx* self = NULL; +int pakfire_ctx_create(pakfire_ctx** ctx, const char* path) { + pakfire_ctx* self = NULL; int r; // Allocate the context @@ -257,13 +257,13 @@ ERROR: return r; } -struct pakfire_ctx* pakfire_ctx_ref(struct pakfire_ctx* self) { +pakfire_ctx* pakfire_ctx_ref(pakfire_ctx* self) { self->nrefs++; return self; } -struct pakfire_ctx* pakfire_ctx_unref(struct pakfire_ctx* self) { +pakfire_ctx* pakfire_ctx_unref(pakfire_ctx* self) { if (--self->nrefs > 0) return self; @@ -273,11 +273,11 @@ struct pakfire_ctx* pakfire_ctx_unref(struct pakfire_ctx* self) { // Flags -int pakfire_ctx_has_flag(struct pakfire_ctx* self, int flag) { +int pakfire_ctx_has_flag(pakfire_ctx* self, int flag) { return self->flags & flag; } -int pakfire_ctx_set_flag(struct pakfire_ctx* self, int flag) { +int pakfire_ctx_set_flag(pakfire_ctx* self, int flag) { self->flags |= flag; return 0; @@ -285,7 +285,7 @@ int pakfire_ctx_set_flag(struct pakfire_ctx* self, int flag) { // Config -struct pakfire_config* pakfire_ctx_get_config(struct pakfire_ctx* self) { +struct pakfire_config* pakfire_ctx_get_config(pakfire_ctx* self) { if (!self->config) return NULL; @@ -294,27 +294,27 @@ struct pakfire_config* pakfire_ctx_get_config(struct pakfire_ctx* self) { // Distro -const struct pakfire_distro* pakfire_ctx_get_distro(struct pakfire_ctx* self) { +const struct pakfire_distro* pakfire_ctx_get_distro(pakfire_ctx* self) { return &self->distro; } // Logging -int pakfire_ctx_get_log_level(struct pakfire_ctx* self) { +int pakfire_ctx_get_log_level(pakfire_ctx* self) { return self->log.level; } -void pakfire_ctx_set_log_level(struct pakfire_ctx* self, int level) { +void pakfire_ctx_set_log_level(pakfire_ctx* self, int level) { self->log.level = level; } -void pakfire_ctx_set_log_callback(struct pakfire_ctx* self, +void pakfire_ctx_set_log_callback(pakfire_ctx* self, pakfire_log_callback callback, void* data) { self->log.callback = callback; self->log.data = data; } -void pakfire_ctx_log(struct pakfire_ctx* self, int level, const char* file, int line, +void pakfire_ctx_log(pakfire_ctx* self, int level, const char* file, int line, const char* fn, const char* format, ...) { va_list args; @@ -329,23 +329,23 @@ void pakfire_ctx_log(struct pakfire_ctx* self, int level, const char* file, int // Paths -const char* pakfire_ctx_get_cache_path(struct pakfire_ctx* self) { +const char* pakfire_ctx_get_cache_path(pakfire_ctx* self) { return self->paths.cache; } -int pakfire_ctx_set_cache_path(struct pakfire_ctx* self, const char* path) { +int pakfire_ctx_set_cache_path(pakfire_ctx* self, const char* path) { return pakfire_path_expand(self->paths.cache, path); } // Confirm -void pakfire_ctx_set_confirm_callback(struct pakfire_ctx* self, +void pakfire_ctx_set_confirm_callback(pakfire_ctx* self, pakfire_confirm_callback callback, void* data) { self->confirm.callback = callback; self->confirm.data = data; } -int pakfire_ctx_confirm(struct pakfire_ctx* self, struct pakfire* pakfire, +int pakfire_ctx_confirm(pakfire_ctx* self, struct pakfire* pakfire, const char* message, const char* question) { // Run callback if (!self->confirm.callback) @@ -356,13 +356,13 @@ int pakfire_ctx_confirm(struct pakfire_ctx* self, struct pakfire* pakfire, // Progress -void pakfire_ctx_set_progress_callback(struct pakfire_ctx* self, +void pakfire_ctx_set_progress_callback(pakfire_ctx* self, pakfire_progress_callback callback, void* data) { self->progress.callback = callback; self->progress.data = data; } -int pakfire_ctx_setup_progress(struct pakfire_ctx* self, struct pakfire_progress* progress) { +int pakfire_ctx_setup_progress(pakfire_ctx* self, struct pakfire_progress* progress) { if (!self->progress.callback) return 0; @@ -371,13 +371,13 @@ int pakfire_ctx_setup_progress(struct pakfire_ctx* self, struct pakfire_progress // Pick Solution -void pakfire_ctx_set_pick_solution_callback(struct pakfire_ctx* self, +void pakfire_ctx_set_pick_solution_callback(pakfire_ctx* self, pakfire_pick_solution_callback callback, void* data) { self->pick_solution.callback = callback; self->pick_solution.data = data; } -int pakfire_ctx_pick_solution(struct pakfire_ctx* self, struct pakfire* pakfire, +int pakfire_ctx_pick_solution(pakfire_ctx* self, struct pakfire* pakfire, struct pakfire_transaction* transaction) { if (!self->pick_solution.callback) return 1; @@ -390,7 +390,7 @@ int pakfire_ctx_pick_solution(struct pakfire_ctx* self, struct pakfire* pakfire, static int pakfire_ctx_loop_exited(sd_event_source* event, void* data); static int pakfire_ctx_loop_started(sd_event_source* event, void* data) { - struct pakfire_ctx* self = data; + pakfire_ctx* self = data; // Log action DEBUG(self, "Event loop started\n"); @@ -407,7 +407,7 @@ static int pakfire_ctx_loop_started(sd_event_source* event, void* data) { } static int pakfire_ctx_loop_exited(sd_event_source* event, void* data) { - struct pakfire_ctx* self = data; + pakfire_ctx* self = data; // Log action DEBUG(self, "Event loop exited\n"); @@ -423,7 +423,7 @@ static int pakfire_ctx_loop_exited(sd_event_source* event, void* data) { &self->events.loop_started, pakfire_ctx_loop_started, self); } -int pakfire_ctx_loop(struct pakfire_ctx* self, sd_event** loop) { +int pakfire_ctx_loop(pakfire_ctx* self, sd_event** loop) { int r; // Initialize the loop whenever we need it @@ -445,13 +445,13 @@ int pakfire_ctx_loop(struct pakfire_ctx* self, sd_event** loop) { return 0; } -int pakfire_ctx_loop_is_running(struct pakfire_ctx* self) { +int pakfire_ctx_loop_is_running(pakfire_ctx* self) { return self->loop_is_running; } // cURL -CURLSH* pakfire_ctx_curl_share(struct pakfire_ctx* self) { +CURLSH* pakfire_ctx_curl_share(pakfire_ctx* self) { int r; // Setup a new handle @@ -483,7 +483,7 @@ ERROR: // Magic -magic_t pakfire_ctx_magic(struct pakfire_ctx* self) { +magic_t pakfire_ctx_magic(pakfire_ctx* self) { int r; // Initialize the context if not already done diff --git a/src/pakfire/ctx.h b/src/pakfire/ctx.h index 12975ab78..41431770d 100644 --- a/src/pakfire/ctx.h +++ b/src/pakfire/ctx.h @@ -21,7 +21,7 @@ #ifndef PAKFIRE_CTX_H #define PAKFIRE_CTX_H -struct pakfire_ctx; +typedef struct pakfire_ctx pakfire_ctx; #include #include @@ -30,10 +30,10 @@ struct pakfire_ctx; #include #include -int pakfire_ctx_create(struct pakfire_ctx** ctx, const char* path); +int pakfire_ctx_create(pakfire_ctx** ctx, const char* path); -struct pakfire_ctx* pakfire_ctx_ref(struct pakfire_ctx* self); -struct pakfire_ctx* pakfire_ctx_unref(struct pakfire_ctx* self); +pakfire_ctx* pakfire_ctx_ref(pakfire_ctx* self); +pakfire_ctx* pakfire_ctx_unref(pakfire_ctx* self); // Flags @@ -42,90 +42,90 @@ enum pakfire_ctx_flags { PAKFIRE_CTX_IN_JAIL = (1 << 1), }; -int pakfire_ctx_has_flag(struct pakfire_ctx* self, int flag); -int pakfire_ctx_set_flag(struct pakfire_ctx* self, int flag); +int pakfire_ctx_has_flag(pakfire_ctx* self, int flag); +int pakfire_ctx_set_flag(pakfire_ctx* self, int flag); // Config -struct pakfire_config* pakfire_ctx_get_config(struct pakfire_ctx* self); +struct pakfire_config* pakfire_ctx_get_config(pakfire_ctx* self); // Logging -int pakfire_ctx_get_log_level(struct pakfire_ctx* self); -void pakfire_ctx_set_log_level(struct pakfire_ctx* self, int level); +int pakfire_ctx_get_log_level(pakfire_ctx* self); +void pakfire_ctx_set_log_level(pakfire_ctx* self, int level); -void pakfire_ctx_set_log_callback(struct pakfire_ctx* self, +void pakfire_ctx_set_log_callback(pakfire_ctx* self, pakfire_log_callback callback, void* data); // Paths -const char* pakfire_ctx_get_cache_path(struct pakfire_ctx* self); -int pakfire_ctx_set_cache_path(struct pakfire_ctx* self, const char* path); +const char* pakfire_ctx_get_cache_path(pakfire_ctx* self); +int pakfire_ctx_set_cache_path(pakfire_ctx* self, const char* path); // Confirm -typedef int (*pakfire_confirm_callback)(struct pakfire_ctx* self, struct pakfire* pakfire, +typedef int (*pakfire_confirm_callback)(pakfire_ctx* self, struct pakfire* pakfire, void* data, const char* message, const char* question); -void pakfire_ctx_set_confirm_callback(struct pakfire_ctx* self, +void pakfire_ctx_set_confirm_callback(pakfire_ctx* self, pakfire_confirm_callback callback, void* data); // Progress -typedef int (*pakfire_progress_callback)(struct pakfire_ctx* self, +typedef int (*pakfire_progress_callback)(pakfire_ctx* self, void* data, struct pakfire_progress* progress); -void pakfire_ctx_set_progress_callback(struct pakfire_ctx* self, +void pakfire_ctx_set_progress_callback(pakfire_ctx* self, pakfire_progress_callback callback, void* data); // Pick Solution -typedef int (*pakfire_pick_solution_callback)(struct pakfire_ctx* self, +typedef int (*pakfire_pick_solution_callback)(pakfire_ctx* self, struct pakfire* pakfire, void* data, struct pakfire_transaction* transaction); -void pakfire_ctx_set_pick_solution_callback(struct pakfire_ctx* self, +void pakfire_ctx_set_pick_solution_callback(pakfire_ctx* self, pakfire_pick_solution_callback callback, void* data); // Distro -const struct pakfire_distro* pakfire_ctx_get_distro(struct pakfire_ctx* self); +const struct pakfire_distro* pakfire_ctx_get_distro(pakfire_ctx* self); // Logging -void pakfire_ctx_log(struct pakfire_ctx* self, int level, const char* file, int line, +void pakfire_ctx_log(pakfire_ctx* self, int level, const char* file, int line, const char* fn, const char* format, ...) __attribute__((format(printf, 6, 7))); // Confirm -int pakfire_ctx_confirm(struct pakfire_ctx* self, struct pakfire* pakfire, +int pakfire_ctx_confirm(pakfire_ctx* self, struct pakfire* pakfire, const char* message, const char* question); // Progress -int pakfire_ctx_setup_progress(struct pakfire_ctx* self, struct pakfire_progress* progress); +int pakfire_ctx_setup_progress(pakfire_ctx* self, struct pakfire_progress* progress); // Pick Solution -int pakfire_ctx_pick_solution(struct pakfire_ctx* self, struct pakfire* pakfire, +int pakfire_ctx_pick_solution(pakfire_ctx* self, struct pakfire* pakfire, struct pakfire_transaction* transaction); // Event Loop #include -int pakfire_ctx_loop(struct pakfire_ctx* self, sd_event** loop); +int pakfire_ctx_loop(pakfire_ctx* self, sd_event** loop); -int pakfire_ctx_loop_is_running(struct pakfire_ctx* self); +int pakfire_ctx_loop_is_running(pakfire_ctx* self); // cURL #include -CURLSH* pakfire_ctx_curl_share(struct pakfire_ctx* self); +CURLSH* pakfire_ctx_curl_share(pakfire_ctx* self); // Magic #include -magic_t pakfire_ctx_magic(struct pakfire_ctx* self); +magic_t pakfire_ctx_magic(pakfire_ctx* self); #endif /* PAKFIRE_CTX_H */ diff --git a/src/pakfire/daemon.c b/src/pakfire/daemon.c index 8a99026b4..804a348a6 100644 --- a/src/pakfire/daemon.c +++ b/src/pakfire/daemon.c @@ -34,7 +34,7 @@ #include struct pakfire_daemon { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Pakfire Client @@ -332,7 +332,7 @@ static void pakfire_daemon_free(struct pakfire_daemon* self) { free(self); } -int pakfire_daemon_create(struct pakfire_daemon** daemon, struct pakfire_ctx* ctx) { +int pakfire_daemon_create(struct pakfire_daemon** daemon, pakfire_ctx* ctx) { struct pakfire_daemon* self = NULL; int r; diff --git a/src/pakfire/daemon.h b/src/pakfire/daemon.h index b77bcd693..369412223 100644 --- a/src/pakfire/daemon.h +++ b/src/pakfire/daemon.h @@ -25,7 +25,7 @@ struct pakfire_daemon; #include -int pakfire_daemon_create(struct pakfire_daemon** daemon, struct pakfire_ctx* ctx); +int pakfire_daemon_create(struct pakfire_daemon** daemon, pakfire_ctx* ctx); struct pakfire_daemon* pakfire_daemon_ref(struct pakfire_daemon* self); struct pakfire_daemon* pakfire_daemon_unref(struct pakfire_daemon* self); diff --git a/src/pakfire/db.c b/src/pakfire/db.c index 73ed487ef..a5bf43be2 100644 --- a/src/pakfire/db.c +++ b/src/pakfire/db.c @@ -47,7 +47,7 @@ #define SCHEMA_MIN_SUP 7 struct pakfire_db { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; @@ -60,7 +60,7 @@ struct pakfire_db { }; static void logging_callback(void* data, int r, const char* msg) { - struct pakfire_ctx* ctx = data; + pakfire_ctx* ctx = data; ERROR(ctx, "Database Error: %s: %s\n", sqlite3_errstr(r), msg); diff --git a/src/pakfire/dist.c b/src/pakfire/dist.c index 1f8d9bec4..df96ea35f 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_get_ctx(pakfire); + pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Create a new parser r = pakfire_parser_create(parser, pakfire, NULL, NULL, PAKFIRE_PARSER_FLAGS_EXPAND_COMMANDS); @@ -230,7 +230,7 @@ ERROR: return r; } -static int pakfire_dist_get_mirrorlist(struct pakfire_ctx* ctx, struct pakfire* pakfire, +static int pakfire_dist_get_mirrorlist(pakfire_ctx* ctx, struct pakfire* pakfire, struct pakfire_parser* makefile, struct pakfire_mirrorlist** list) { struct pakfire_mirrorlist* m = NULL; struct pakfire_mirror* mirror = NULL; @@ -280,11 +280,11 @@ ERROR: return r; } -static int pakfire_dist_download_source(struct pakfire_ctx* ctx, +static int pakfire_dist_download_source(pakfire_ctx* ctx, struct pakfire_mirrorlist* mirrorlist, const char* cache_path, const char* filename, ...) __attribute__((format(printf, 4, 5))); -static int pakfire_dist_download_source(struct pakfire_ctx* ctx, +static int pakfire_dist_download_source(pakfire_ctx* ctx, struct pakfire_mirrorlist* mirrorlist, const char* cache_path, const char* filename, ...) { struct pakfire_xfer* xfer = NULL; va_list args; @@ -325,7 +325,7 @@ ERROR: } static int pakfire_dist_add_source(struct pakfire* pakfire, struct pakfire_packager* packager, - struct pakfire_package* pkg, struct pakfire_ctx* ctx, + struct pakfire_package* pkg, pakfire_ctx* ctx, struct pakfire_mirrorlist* mirrorlist, const char* filename) { char archive_path[PATH_MAX]; char cache_path[PATH_MAX]; @@ -351,7 +351,7 @@ static int pakfire_dist_add_source(struct pakfire* pakfire, struct pakfire_packa return pakfire_packager_add(packager, cache_path, archive_path); } -static int pakfire_dist_add_sources(struct pakfire_ctx* ctx, struct pakfire* pakfire, +static int pakfire_dist_add_sources(pakfire_ctx* ctx, struct pakfire* pakfire, struct pakfire_packager* packager, struct pakfire_package* pkg, struct pakfire_parser* makefile) { struct pakfire_mirrorlist* mirrorlist = NULL; char* sources = NULL; @@ -412,7 +412,7 @@ static int __pakfire_dist_find_root(char* root, const size_t length, const char* return __pakfire_path_dirname(root, length, p); } -static int pakfire_dist_add_files(struct pakfire_ctx* ctx, struct pakfire* pakfire, +static int pakfire_dist_add_files(pakfire_ctx* ctx, struct pakfire* pakfire, struct pakfire_packager* packager, const char* file) { struct pakfire_filelist* filelist = NULL; char root[PATH_MAX]; @@ -460,7 +460,7 @@ int pakfire_dist(struct pakfire* pakfire, int r; // Fetch context - struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); + pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Load makefile r = pakfire_read_makefile(&makefile, pakfire, path, &error); diff --git a/src/pakfire/elf.c b/src/pakfire/elf.c index 6c97b18c3..97540f5f2 100644 --- a/src/pakfire/elf.c +++ b/src/pakfire/elf.c @@ -34,7 +34,7 @@ #include struct pakfire_elf { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Path @@ -68,7 +68,7 @@ struct pakfire_elf { const char* debuglink; }; -static int pakfire_elf_init_libelf(struct pakfire_ctx* ctx) { +static int pakfire_elf_init_libelf(pakfire_ctx* ctx) { // Initialize libelf if (elf_version(EV_CURRENT) == EV_NONE) { ERROR(ctx, "Could not initialize libelf: %s\n", elf_errmsg(-1)); @@ -142,7 +142,7 @@ static void pakfire_elf_free(struct pakfire_elf* self) { } int pakfire_elf_open(struct pakfire_elf** elf, - struct pakfire_ctx* ctx, const char* path, int fd) { + pakfire_ctx* ctx, const char* path, int fd) { struct pakfire_elf* self = NULL; int r; @@ -191,7 +191,7 @@ ERROR: } int pakfire_elf_open_file(struct pakfire_elf** elf, - struct pakfire_ctx* ctx, struct pakfire_file* file) { + pakfire_ctx* ctx, struct pakfire_file* file) { const char* path = NULL; int fd = -EBADF; int r; diff --git a/src/pakfire/elf.h b/src/pakfire/elf.h index 1d0c88841..3f9e954ab 100644 --- a/src/pakfire/elf.h +++ b/src/pakfire/elf.h @@ -27,9 +27,9 @@ struct pakfire_elf; #include int pakfire_elf_open(struct pakfire_elf** elf, - struct pakfire_ctx* ctx, const char* path, int fd); + pakfire_ctx* ctx, const char* path, int fd); int pakfire_elf_open_file(struct pakfire_elf** elf, - struct pakfire_ctx* ctx, struct pakfire_file* file); + pakfire_ctx* ctx, struct pakfire_file* file); struct pakfire_elf* pakfire_elf_ref(struct pakfire_elf* self); struct pakfire_elf* pakfire_elf_unref(struct pakfire_elf* self); @@ -67,7 +67,7 @@ int pakfire_elf_requires(struct pakfire_elf* self, char*** requires); // Source Files typedef int (*pakfire_elf_foreach_source_file_callback) - (struct pakfire_ctx* ctx, struct pakfire_elf* elf, const char* filename, void* data); + (pakfire_ctx* ctx, struct pakfire_elf* elf, const char* filename, void* data); int pakfire_elf_foreach_source_file(struct pakfire_elf* self, pakfire_elf_foreach_source_file_callback callback, void* data); diff --git a/src/pakfire/env.c b/src/pakfire/env.c index 9ea23019c..ab1a0f1f6 100644 --- a/src/pakfire/env.c +++ b/src/pakfire/env.c @@ -28,7 +28,7 @@ #define ENVIRON_SIZE 128 struct pakfire_env { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; char* env[ENVIRON_SIZE]; @@ -44,7 +44,7 @@ static void pakfire_env_free(struct pakfire_env* env) { free(env); } -int pakfire_env_create(struct pakfire_env** env, struct pakfire_ctx* ctx) { +int pakfire_env_create(struct pakfire_env** env, pakfire_ctx* ctx) { struct pakfire_env* e = NULL; // Allocate a new environment diff --git a/src/pakfire/env.h b/src/pakfire/env.h index 3fb911639..05fbe438b 100644 --- a/src/pakfire/env.h +++ b/src/pakfire/env.h @@ -25,7 +25,7 @@ struct pakfire_env; #include -int pakfire_env_create(struct pakfire_env** env, struct pakfire_ctx* ctx); +int pakfire_env_create(struct pakfire_env** env, pakfire_ctx* ctx); struct pakfire_env* pakfire_env_ref(struct pakfire_env* env); struct pakfire_env* pakfire_env_unref(struct pakfire_env* env); diff --git a/src/pakfire/fhs.c b/src/pakfire/fhs.c index 01f20b2e6..55631be6c 100644 --- a/src/pakfire/fhs.c +++ b/src/pakfire/fhs.c @@ -202,7 +202,7 @@ static const struct pakfire_fhs_check { }; static const struct pakfire_fhs_check* pakfire_fhs_find_check( - struct pakfire_ctx* ctx, struct pakfire_file* file) { + pakfire_ctx* ctx, struct pakfire_file* file) { const struct pakfire_fhs_check* check = NULL; char path[PATH_MAX]; int r; @@ -247,7 +247,7 @@ ERROR: } static int pakfire_fhs_check_world_writable( - struct pakfire_ctx* ctx, struct pakfire_file* file) { + pakfire_ctx* ctx, struct pakfire_file* file) { // Run this check only for regular files switch (pakfire_file_get_type(file)) { case S_IFREG: @@ -272,7 +272,7 @@ static int pakfire_fhs_check_world_writable( return 0; } -static int pakfire_fhs_check_perms(struct pakfire_ctx* ctx, +static int pakfire_fhs_check_perms(pakfire_ctx* ctx, const struct pakfire_fhs_check* check, struct pakfire_file* file) { // No permissions defined. Skipping check... if (!check->perms) @@ -293,7 +293,7 @@ static int pakfire_fhs_check_perms(struct pakfire_ctx* ctx, return 0; } -static int pakfire_fhs_check_ownership(struct pakfire_ctx* ctx, +static int pakfire_fhs_check_ownership(pakfire_ctx* ctx, const struct pakfire_fhs_check* check, struct pakfire_file* file) { const char* path = pakfire_file_get_path(file); @@ -325,7 +325,7 @@ static int pakfire_fhs_check_ownership(struct pakfire_ctx* ctx, return 0; } -static int pakfire_fhs_check_noexec(struct pakfire_ctx* ctx, +static int pakfire_fhs_check_noexec(pakfire_ctx* ctx, const struct pakfire_fhs_check* check, struct pakfire_file* file) { // Skip this check if PAKFIRE_FHS_CHECK_NOEXEC is not set if (!(check->flags & PAKFIRE_FHS_CHECK_NOEXEC)) @@ -346,7 +346,7 @@ static int pakfire_fhs_check_noexec(struct pakfire_ctx* ctx, return 0; } -int pakfire_fhs_check_file(struct pakfire_ctx* ctx, struct pakfire_file* file) { +int pakfire_fhs_check_file(pakfire_ctx* ctx, struct pakfire_file* file) { const struct pakfire_fhs_check* check = NULL; int status = 0; int r; diff --git a/src/pakfire/fhs.h b/src/pakfire/fhs.h index aae6b28cd..88ebb2599 100644 --- a/src/pakfire/fhs.h +++ b/src/pakfire/fhs.h @@ -33,6 +33,6 @@ enum pakfire_fhs_status { PAKFIRE_FHS_NOEXEC = (1 << 5), }; -int pakfire_fhs_check_file(struct pakfire_ctx* ctx, struct pakfire_file* file); +int pakfire_fhs_check_file(pakfire_ctx* ctx, struct pakfire_file* file); #endif /* PAKFIRE_FHS_H */ diff --git a/src/pakfire/file.c b/src/pakfire/file.c index 176fde31a..5ac6e25b1 100644 --- a/src/pakfire/file.c +++ b/src/pakfire/file.c @@ -61,7 +61,7 @@ enum pakfire_file_verification_status { }; struct pakfire_file { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; diff --git a/src/pakfire/filelist.c b/src/pakfire/filelist.c index f2e6011b3..6b785dff0 100644 --- a/src/pakfire/filelist.c +++ b/src/pakfire/filelist.c @@ -36,7 +36,7 @@ #include struct pakfire_filelist { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; @@ -228,7 +228,7 @@ static int pakfire_filelist_remove(struct pakfire_filelist* list, struct pakfire } static int __pakfire_filelist_remove_one( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_filelist* list = data; // Remove the file from the given filelist @@ -553,7 +553,7 @@ ERROR: } static int __pakfire_filelist_dump( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { int* flags = data; char* s = pakfire_file_dump(file, *flags); @@ -648,7 +648,7 @@ int pakfire_filelist_cleanup(struct pakfire_filelist* list, int flags) { } static int __pakfire_filelist_matches_class( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { int* class = data; return pakfire_file_matches_class(file, *class); diff --git a/src/pakfire/filelist.h b/src/pakfire/filelist.h index 137701988..eb87174c0 100644 --- a/src/pakfire/filelist.h +++ b/src/pakfire/filelist.h @@ -58,7 +58,7 @@ int pakfire_filelist_scan(struct pakfire_filelist* list, const char* root, int pakfire_filelist_contains(struct pakfire_filelist* list, const char* pattern); typedef int (*pakfire_filelist_walk_callback) - (struct pakfire_ctx* ctx, struct pakfire_file* file, void* data); + (pakfire_ctx* ctx, struct pakfire_file* file, void* data); enum pakfire_filelist_walk_flags { PAKFIRE_FILELIST_SHOW_PROGRESS = (1 << 0), diff --git a/src/pakfire/hasher.c b/src/pakfire/hasher.c index d588f082f..b1193d4d9 100644 --- a/src/pakfire/hasher.c +++ b/src/pakfire/hasher.c @@ -32,7 +32,7 @@ #include struct pakfire_hasher { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Selected hashes @@ -144,7 +144,7 @@ static int pakfire_hasher_setup_hashes(struct pakfire_hasher* self) { } int pakfire_hasher_create(struct pakfire_hasher** hasher, - struct pakfire_ctx* ctx, enum pakfire_hash_type types) { + pakfire_ctx* ctx, enum pakfire_hash_type types) { struct pakfire_hasher* self = NULL; int r; @@ -318,7 +318,7 @@ int pakfire_hasher_finalize(struct pakfire_hasher* self, struct pakfire_hashes* /* * Convenience function to hash a buffer */ -int pakfire_hash_buffer(struct pakfire_ctx* ctx, const char* buffer, const size_t length, +int pakfire_hash_buffer(pakfire_ctx* ctx, const char* buffer, const size_t length, const enum pakfire_hash_type types, struct pakfire_hashes* hashes) { struct pakfire_hasher* hasher = NULL; int r; @@ -351,7 +351,7 @@ ERROR: /* Convenience function to hash a file */ -int pakfire_hash_file(struct pakfire_ctx* ctx, +int pakfire_hash_file(pakfire_ctx* ctx, FILE* f, const enum pakfire_hash_type types, struct pakfire_hashes* hashes) { struct pakfire_hasher* hasher = NULL; char buffer[65536]; @@ -394,7 +394,7 @@ ERROR: return r; } -int pakfire_hash_path(struct pakfire_ctx* ctx, +int pakfire_hash_path(pakfire_ctx* ctx, const char* path, const enum pakfire_hash_type types, struct pakfire_hashes* hashes) { FILE* f = NULL; int r; diff --git a/src/pakfire/hasher.h b/src/pakfire/hasher.h index 4324a82fc..cabf65dc3 100644 --- a/src/pakfire/hasher.h +++ b/src/pakfire/hasher.h @@ -29,7 +29,7 @@ struct pakfire_hasher; int pakfire_hasher_create(struct pakfire_hasher** hasher, - struct pakfire_ctx* ctx, enum pakfire_hash_type types); + pakfire_ctx* ctx, enum pakfire_hash_type types); struct pakfire_hasher* pakfire_hasher_ref(struct pakfire_hasher* self); struct pakfire_hasher* pakfire_hasher_unref(struct pakfire_hasher* self); @@ -37,11 +37,11 @@ struct pakfire_hasher* pakfire_hasher_unref(struct pakfire_hasher* self); int pakfire_hasher_update(struct pakfire_hasher* self, const char* buffer, const size_t length); int pakfire_hasher_finalize(struct pakfire_hasher* self, struct pakfire_hashes* computed_hashes); -int pakfire_hash_buffer(struct pakfire_ctx* ctx, const char* buffer, const size_t length, +int pakfire_hash_buffer(pakfire_ctx* ctx, const char* buffer, const size_t length, const enum pakfire_hash_type types, struct pakfire_hashes* hashes); -int pakfire_hash_file(struct pakfire_ctx* ctx, +int pakfire_hash_file(pakfire_ctx* ctx, FILE* f, enum pakfire_hash_type types, struct pakfire_hashes* hashes); -int pakfire_hash_path(struct pakfire_ctx* ctx, +int pakfire_hash_path(pakfire_ctx* ctx, const char* path, const enum pakfire_hash_type types, struct pakfire_hashes* hashes); #endif /* PAKFIRE_HASHER_H */ diff --git a/src/pakfire/hashes.c b/src/pakfire/hashes.c index 471a710ed..333faa5f8 100644 --- a/src/pakfire/hashes.c +++ b/src/pakfire/hashes.c @@ -291,7 +291,7 @@ int pakfire_hashes_set_hex(struct pakfire_hashes* hashes, return 0; } -static int __pakfire_hashes_dump(struct pakfire_ctx* ctx, +static int __pakfire_hashes_dump(pakfire_ctx* ctx, const struct pakfire_hashes* hashes, const enum pakfire_hash_type hash, int level) { char* hexdigest = NULL; int r; @@ -315,7 +315,7 @@ ERROR: return r; } -int pakfire_hashes_dump(struct pakfire_ctx* ctx, const struct pakfire_hashes* hashes, int level) { +int pakfire_hashes_dump(pakfire_ctx* ctx, const struct pakfire_hashes* hashes, int level) { enum pakfire_hash_type hash = PAKFIRE_HASH_UNDEFINED; int r; @@ -328,7 +328,7 @@ int pakfire_hashes_dump(struct pakfire_ctx* ctx, const struct pakfire_hashes* ha return 0; } -static int __pakfire_hashes_compare(struct pakfire_ctx* ctx, const enum pakfire_hash_type hash, +static int __pakfire_hashes_compare(pakfire_ctx* ctx, const enum pakfire_hash_type hash, const struct pakfire_hashes* hashes1, const struct pakfire_hashes* hashes2) { int r; @@ -373,7 +373,7 @@ static int __pakfire_hashes_compare(struct pakfire_ctx* ctx, const enum pakfire_ return r; } -int pakfire_hashes_compare(struct pakfire_ctx* ctx, +int pakfire_hashes_compare(pakfire_ctx* ctx, const struct pakfire_hashes* hashes1, const struct pakfire_hashes* hashes2) { enum pakfire_hash_type hash = PAKFIRE_HASH_UNDEFINED; int r; diff --git a/src/pakfire/hashes.h b/src/pakfire/hashes.h index e7a27b57b..b225df7c4 100644 --- a/src/pakfire/hashes.h +++ b/src/pakfire/hashes.h @@ -98,9 +98,9 @@ int pakfire_hashes_get_hex(const struct pakfire_hashes* hashes, int pakfire_hashes_set_hex(struct pakfire_hashes* hashes, const enum pakfire_hash_type type, const char* hexdigest); -int pakfire_hashes_dump(struct pakfire_ctx* ctx, const struct pakfire_hashes* hashes, int level); +int pakfire_hashes_dump(pakfire_ctx* ctx, const struct pakfire_hashes* hashes, int level); -int pakfire_hashes_compare(struct pakfire_ctx* ctx, +int pakfire_hashes_compare(pakfire_ctx* ctx, const struct pakfire_hashes* hashes1, const struct pakfire_hashes* hashes2); #endif /* PAKFIRE_HASHES_H */ diff --git a/src/pakfire/httpclient.c b/src/pakfire/httpclient.c index 0aac81c6e..fd14bc0bf 100644 --- a/src/pakfire/httpclient.c +++ b/src/pakfire/httpclient.c @@ -50,7 +50,7 @@ struct pakfire_httpclient_xfer { }; struct pakfire_httpclient { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Flags @@ -696,7 +696,7 @@ static void pakfire_httpclient_free(struct pakfire_httpclient* self) { } int pakfire_httpclient_create(struct pakfire_httpclient** client, - struct pakfire_ctx* ctx, int progress_flags) { + pakfire_ctx* ctx, int progress_flags) { struct pakfire_httpclient* self = NULL; int r; diff --git a/src/pakfire/httpclient.h b/src/pakfire/httpclient.h index 8031834bc..0fcce7a91 100644 --- a/src/pakfire/httpclient.h +++ b/src/pakfire/httpclient.h @@ -27,7 +27,7 @@ struct pakfire_httpclient; #include int pakfire_httpclient_create(struct pakfire_httpclient** client, - struct pakfire_ctx* ctx, int progress_flags); + pakfire_ctx* ctx, int progress_flags); struct pakfire_httpclient* pakfire_httpclient_ref(struct pakfire_httpclient* self); struct pakfire_httpclient* pakfire_httpclient_unref(struct pakfire_httpclient* self); diff --git a/src/pakfire/jail.c b/src/pakfire/jail.c index 858593f69..87b612d01 100644 --- a/src/pakfire/jail.c +++ b/src/pakfire/jail.c @@ -90,7 +90,7 @@ struct pakfire_jail_mountpoint { }; struct pakfire_jail { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; @@ -568,21 +568,21 @@ static void pakfire_jail_log_redirect(void* data, int priority, const char* file /* Passes any log messages on to the context logger */ -static int pakfire_jail_INFO(struct pakfire_ctx* ctx, void* data, const char* line, size_t length) { +static int pakfire_jail_INFO(pakfire_ctx* ctx, void* data, const char* line, size_t length) { struct pakfire_jail* jail = data; INFO(jail->ctx, "%.*s", (int)length, line); return 0; } -static int pakfire_jail_WARN(struct pakfire_ctx* ctx, void* data, const char* line, size_t length) { +static int pakfire_jail_WARN(pakfire_ctx* ctx, void* data, const char* line, size_t length) { struct pakfire_jail* jail = data; ERROR(jail->ctx, "%.*s", (int)length, line); return 0; } -static int pakfire_jail_ERROR(struct pakfire_ctx* ctx, void* data, const char* line, size_t length) { +static int pakfire_jail_ERROR(pakfire_ctx* ctx, void* data, const char* line, size_t length) { struct pakfire_jail* jail = data; ERROR(jail->ctx, "%.*s", (int)length, line); @@ -590,7 +590,7 @@ static int pakfire_jail_ERROR(struct pakfire_ctx* ctx, void* data, const char* l } #ifdef ENABLE_DEBUG -static int pakfire_jail_DEBUG(struct pakfire_ctx* ctx, void* data, const char* line, size_t length) { +static int pakfire_jail_DEBUG(pakfire_ctx* ctx, void* data, const char* line, size_t length) { struct pakfire_jail* jail = data; DEBUG(jail->ctx, "%.*s", (int)length, line); @@ -598,7 +598,7 @@ static int pakfire_jail_DEBUG(struct pakfire_ctx* ctx, void* data, const char* l } #endif /* ENABLE_DEBUG */ -static int pakfire_jail_output_stdout(struct pakfire_ctx* ctx, void* data, const char* line, size_t length) { +static int pakfire_jail_output_stdout(pakfire_ctx* ctx, void* data, const char* line, size_t length) { struct pakfire_jail_exec* exec = data; // Do nothing if we don't have a callback @@ -608,7 +608,7 @@ static int pakfire_jail_output_stdout(struct pakfire_ctx* ctx, void* data, const return exec->callbacks.output(ctx, exec->callbacks.output_data, PAKFIRE_STDOUT, line, length); } -static int pakfire_jail_output_stderr(struct pakfire_ctx* ctx, void* data, const char* line, size_t length) { +static int pakfire_jail_output_stderr(pakfire_ctx* ctx, void* data, const char* line, size_t length) { struct pakfire_jail_exec* exec = data; // Do nothing if we don't have a callback @@ -1224,7 +1224,7 @@ struct pakfire_jail_command { struct pakfire_env* env; }; -static int pakfire_jail_launch_command(struct pakfire_ctx* ctx, void* data) { +static int pakfire_jail_launch_command(pakfire_ctx* ctx, void* data) { struct pakfire_jail_command* command = data; struct pakfire_env* env = NULL; char** envp = NULL; @@ -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_get_ctx(pakfire); + pakfire_ctx* ctx = pakfire_get_ctx(pakfire); r = pakfire_path(pakfire, path, "%s", *argv); if (r) @@ -2300,7 +2300,7 @@ int pakfire_jail_run_systemd_tmpfiles(struct pakfire* pakfire) { return pakfire_jail_run_if_possible(pakfire, argv); } -ssize_t pakfire_jail_send_buffer(struct pakfire_ctx* ctx, +ssize_t pakfire_jail_send_buffer(pakfire_ctx* ctx, void* data, char* buffer, size_t length) { struct pakfire_input_buffer* input = data; @@ -2326,7 +2326,7 @@ ssize_t pakfire_jail_send_buffer(struct pakfire_ctx* ctx, return length; } -ssize_t pakfire_jail_send_filelist(struct pakfire_ctx* ctx, +ssize_t pakfire_jail_send_filelist(pakfire_ctx* ctx, void* data, char* buffer, size_t length) { struct pakfire_jail_filelist* input = data; struct pakfire_file* file = NULL; diff --git a/src/pakfire/jail.h b/src/pakfire/jail.h index 82defa99d..e86a63509 100644 --- a/src/pakfire/jail.h +++ b/src/pakfire/jail.h @@ -37,7 +37,7 @@ enum pakfire_jail_output_stream { PAKFIRE_STDERR, }; -typedef int (*pakfire_jail_output_callback)(struct pakfire_ctx* ctx, void* data, +typedef int (*pakfire_jail_output_callback)(pakfire_ctx* ctx, void* data, const enum pakfire_jail_output_stream stream, const char* line, size_t length); int pakfire_jail_create(struct pakfire_jail** jail, struct pakfire* pakfire); @@ -55,7 +55,7 @@ int pakfire_jail_nice(struct pakfire_jail* jail, int nice); // Timeout int pakfire_jail_set_timeout(struct pakfire_jail* jail, unsigned int timeout); -typedef int (*pakfire_jail_main_callback)(struct pakfire_ctx* ctx, void* data); +typedef int (*pakfire_jail_main_callback)(pakfire_ctx* ctx, void* data); enum pakfire_jail_exec_flags { PAKFIRE_JAIL_INTERACTIVE = (1 << 0), @@ -102,7 +102,7 @@ struct pakfire_input_buffer { size_t length; }; -ssize_t pakfire_jail_send_buffer(struct pakfire_ctx* ctx, +ssize_t pakfire_jail_send_buffer(pakfire_ctx* ctx, void* data, char* buffer, size_t length); // Stream a filelist @@ -116,7 +116,7 @@ struct pakfire_jail_filelist { const char* p; }; -ssize_t pakfire_jail_send_filelist(struct pakfire_ctx* ctx, +ssize_t pakfire_jail_send_filelist(pakfire_ctx* ctx, void* data, char* buffer, size_t length); #endif /* PAKFIRE_JAIL_H */ diff --git a/src/pakfire/job.c b/src/pakfire/job.c index 3514e3b04..01d639bf7 100644 --- a/src/pakfire/job.c +++ b/src/pakfire/job.c @@ -51,7 +51,7 @@ #include struct pakfire_job { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Builder @@ -406,7 +406,7 @@ static int pakfire_job_logfile_uploaded(struct pakfire_client* client, return pakfire_job_upload_packages(self); } -static int pakfire_job_result(struct pakfire_ctx* ctx, struct pakfire* pakfire, +static int pakfire_job_result(pakfire_ctx* ctx, struct pakfire* pakfire, struct pakfire_build* build, struct pakfire_archive* archive, void* data) { struct pakfire_job* self = data; struct pakfire_package* pkg = NULL; @@ -535,7 +535,7 @@ static int pakfire_job_send_log(struct pakfire_job* job, int priority, const cha return pakfire_builder_stream_logs(job->builder); } -static int pakfire_job_stdout(struct pakfire_ctx* ctx, +static int pakfire_job_stdout(pakfire_ctx* ctx, void* data, const char* line, size_t length) { struct pakfire_job* job = data; @@ -543,7 +543,7 @@ static int pakfire_job_stdout(struct pakfire_ctx* ctx, return pakfire_job_send_log(job, LOG_INFO, line, length); } -static int pakfire_job_stderr(struct pakfire_ctx* ctx, +static int pakfire_job_stderr(pakfire_ctx* ctx, void* data, const char* line, size_t length) { struct pakfire_job* job = data; @@ -614,7 +614,7 @@ static void pakfire_job_log(void* data, int priority, const char* file, } static int pakfire_job_child(struct pakfire_job* job) { - struct pakfire_ctx* ctx = NULL; + pakfire_ctx* ctx = NULL; struct pakfire_build* build = NULL; int build_flags = 0; int r; @@ -856,7 +856,7 @@ int pakfire_job_stream_logs(struct pakfire_job* self) { return 1; } -int pakfire_job_create(struct pakfire_job** job, struct pakfire_ctx* ctx, +int pakfire_job_create(struct pakfire_job** job, pakfire_ctx* ctx, struct pakfire_client* client, struct pakfire_builder* builder, json_object* data) { struct pakfire_job* j = NULL; char* p = NULL; diff --git a/src/pakfire/job.h b/src/pakfire/job.h index 69e28559a..576c6dd63 100644 --- a/src/pakfire/job.h +++ b/src/pakfire/job.h @@ -29,7 +29,7 @@ struct pakfire_job; -int pakfire_job_create(struct pakfire_job** worker, struct pakfire_ctx* ctx, +int pakfire_job_create(struct pakfire_job** worker, pakfire_ctx* ctx, struct pakfire_client* client, struct pakfire_builder* builder, json_object* data); struct pakfire_job* pakfire_job_ref(struct pakfire_job* worker); diff --git a/src/pakfire/key.c b/src/pakfire/key.c index db945dec6..58b2402db 100644 --- a/src/pakfire/key.c +++ b/src/pakfire/key.c @@ -49,7 +49,7 @@ #define ERROR_MAX 1024 struct pakfire_key { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Algorithm @@ -94,7 +94,7 @@ static int pakfire_key_id_equals(const pakfire_key_id* id1, const pakfire_key_id return !memcmp(*id1, *id2, sizeof(*id1)); } -static int pakfire_key_create(struct pakfire_key** key, struct pakfire_ctx* ctx, +static int pakfire_key_create(struct pakfire_key** key, pakfire_ctx* ctx, const pakfire_key_algo_t algo, const pakfire_key_id id, EVP_PKEY* pkey, const char* comment) { struct pakfire_key* k = NULL; int r = 0; @@ -195,7 +195,7 @@ const char* pakfire_key_get_comment(struct pakfire_key* key) { return key->comment; } -int pakfire_key_generate(struct pakfire_key** key, struct pakfire_ctx* ctx, +int pakfire_key_generate(struct pakfire_key** key, pakfire_ctx* ctx, const pakfire_key_algo_t algo, const char* comment) { EVP_PKEY* pkey = NULL; EVP_PKEY_CTX* pctx = NULL; @@ -272,7 +272,7 @@ ERROR: */ static int pakfire_key_import_secret_key(struct pakfire_key** key, - struct pakfire_ctx* ctx, const char* comment, + pakfire_ctx* ctx, const char* comment, const struct pakfire_key_private_key* buffer) { const pakfire_key_algo_t algo = PAKFIRE_KEY_ALGO_ED25519; EVP_PKEY* pkey = NULL; @@ -347,7 +347,7 @@ ERROR: } static int pakfire_key_import_public_key(struct pakfire_key** key, - struct pakfire_ctx* ctx, const char* comment, + pakfire_ctx* ctx, const char* comment, const struct pakfire_key_public_key* buffer) { const pakfire_key_algo_t algo = PAKFIRE_KEY_ALGO_ED25519; EVP_PKEY* pkey = NULL; @@ -389,7 +389,7 @@ ERROR: } int pakfire_key_import(struct pakfire_key** key, - struct pakfire_ctx* ctx, FILE* f) { + pakfire_ctx* ctx, FILE* f) { unsigned char* buffer = NULL; size_t buffer_length = 0; int r; @@ -483,7 +483,7 @@ ERROR: } int pakfire_key_import_from_string(struct pakfire_key** key, - struct pakfire_ctx* ctx, const char* data, const size_t length) { + pakfire_ctx* ctx, const char* data, const size_t length) { FILE* f = NULL; int r; diff --git a/src/pakfire/key.h b/src/pakfire/key.h index 55a6cc794..c69ecaf86 100644 --- a/src/pakfire/key.h +++ b/src/pakfire/key.h @@ -47,11 +47,11 @@ pakfire_key_id* pakfire_key_get_id(struct pakfire_key* key); const char* pakfire_key_get_algo(struct pakfire_key* key); const char* pakfire_key_get_comment(struct pakfire_key* key); -int pakfire_key_generate(struct pakfire_key** key, struct pakfire_ctx* ctx, +int pakfire_key_generate(struct pakfire_key** key, pakfire_ctx* ctx, const pakfire_key_algo_t algo, const char* comment); int pakfire_key_export(struct pakfire_key* key, FILE* f, const pakfire_key_export_mode_t mode); int pakfire_key_export_string(struct pakfire_key* self, char** buffer, size_t* length); -int pakfire_key_import(struct pakfire_key** key, struct pakfire_ctx* ctx, FILE* f); +int pakfire_key_import(struct pakfire_key** key, pakfire_ctx* ctx, FILE* f); // Sign int pakfire_key_sign(struct pakfire_key* key, FILE* s, FILE* f, const char* comment); @@ -61,6 +61,6 @@ int pakfire_key_verify(struct pakfire_key* key, FILE* f, const void* data, const size_t length); int pakfire_key_import_from_string(struct pakfire_key** key, - struct pakfire_ctx* ctx, const char* data, const size_t length); + pakfire_ctx* ctx, const char* data, const size_t length); #endif /* PAKFIRE_KEY_H */ diff --git a/src/pakfire/linter-file.c b/src/pakfire/linter-file.c index 61424f961..64a27ef0d 100644 --- a/src/pakfire/linter-file.c +++ b/src/pakfire/linter-file.c @@ -34,7 +34,7 @@ #include struct pakfire_linter_file { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Linter @@ -108,7 +108,7 @@ static void pakfire_linter_file_free(struct pakfire_linter_file* lfile) { } int pakfire_linter_file_create(struct pakfire_linter_file** lfile, - struct pakfire_ctx* ctx, struct pakfire_linter* linter, struct pakfire_file* file, int fd) { + pakfire_ctx* ctx, struct pakfire_linter* linter, struct pakfire_file* file, int fd) { struct pakfire_linter_file* l = NULL; int r = 0; diff --git a/src/pakfire/linter-file.h b/src/pakfire/linter-file.h index 88845f608..f899eb92c 100644 --- a/src/pakfire/linter-file.h +++ b/src/pakfire/linter-file.h @@ -28,7 +28,7 @@ struct pakfire_linter_file; #include int pakfire_linter_file_create(struct pakfire_linter_file** lfile, - struct pakfire_ctx* ctx, struct pakfire_linter* linter, struct pakfire_file* file, int fd); + pakfire_ctx* ctx, struct pakfire_linter* linter, struct pakfire_file* file, int fd); struct pakfire_linter_file* pakfire_linter_file_ref(struct pakfire_linter_file* lfile); struct pakfire_linter_file* pakfire_linter_file_unref(struct pakfire_linter_file* lfile); diff --git a/src/pakfire/linter.c b/src/pakfire/linter.c index 59cd49f44..605511370 100644 --- a/src/pakfire/linter.c +++ b/src/pakfire/linter.c @@ -53,7 +53,7 @@ struct pakfire_linter_result { }; struct pakfire_linter { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Pakfire @@ -546,7 +546,7 @@ static int pakfire_linter_dump_results( } static int __pakfire_linter_dump_file( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_linter* linter = data; // Show information about the file diff --git a/src/pakfire/linter.h b/src/pakfire/linter.h index 586f9283c..6c1c5d043 100644 --- a/src/pakfire/linter.h +++ b/src/pakfire/linter.h @@ -32,7 +32,7 @@ enum pakfire_linter_priority { PAKFIRE_LINTER_ERROR, }; -typedef int (*pakfire_linter_result_callback)(struct pakfire_ctx* ctx, +typedef int (*pakfire_linter_result_callback)(pakfire_ctx* ctx, struct pakfire_archive* archive, struct pakfire_package* package, struct pakfire_file* file, int priority, const char* message, void* data); diff --git a/src/pakfire/log_buffer.c b/src/pakfire/log_buffer.c index 3ef66368f..285ef3840 100644 --- a/src/pakfire/log_buffer.c +++ b/src/pakfire/log_buffer.c @@ -36,7 +36,7 @@ struct pakfire_log_line { }; struct pakfire_log_buffer { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; STAILQ_HEAD(lines, pakfire_log_line) lines; @@ -68,7 +68,7 @@ static void pakfire_log_buffer_free(struct pakfire_log_buffer* buffer) { free(buffer); } -int pakfire_log_buffer_create(struct pakfire_log_buffer** buffer, struct pakfire_ctx* ctx, size_t max_length) { +int pakfire_log_buffer_create(struct pakfire_log_buffer** buffer, pakfire_ctx* ctx, size_t max_length) { struct pakfire_log_buffer* b = NULL; // Allocate a new object diff --git a/src/pakfire/log_buffer.h b/src/pakfire/log_buffer.h index 09ccb9ea1..9831384b1 100644 --- a/src/pakfire/log_buffer.h +++ b/src/pakfire/log_buffer.h @@ -31,7 +31,7 @@ struct pakfire_log_buffer; -int pakfire_log_buffer_create(struct pakfire_log_buffer** buffer, struct pakfire_ctx* ctx, size_t size); +int pakfire_log_buffer_create(struct pakfire_log_buffer** buffer, pakfire_ctx* ctx, size_t size); struct pakfire_log_buffer* pakfire_log_buffer_ref(struct pakfire_log_buffer* buffer); struct pakfire_log_buffer* pakfire_log_buffer_unref(struct pakfire_log_buffer* buffer); diff --git a/src/pakfire/log_file.c b/src/pakfire/log_file.c index 4cdbcf091..92776be1c 100644 --- a/src/pakfire/log_file.c +++ b/src/pakfire/log_file.c @@ -30,7 +30,7 @@ #define MAX_LINE_LENGTH 4096 struct pakfire_log_file { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Filename @@ -66,7 +66,7 @@ static void pakfire_log_file_free(struct pakfire_log_file* self) { free(self); } -int pakfire_log_file_create(struct pakfire_log_file** file, struct pakfire_ctx* ctx, +int pakfire_log_file_create(struct pakfire_log_file** file, pakfire_ctx* ctx, const char* path, const char* filename, int flags) { struct pakfire_log_file* self = NULL; int r; diff --git a/src/pakfire/log_file.h b/src/pakfire/log_file.h index 2de233879..b930ac064 100644 --- a/src/pakfire/log_file.h +++ b/src/pakfire/log_file.h @@ -34,7 +34,7 @@ enum pakfire_log_file_flags { }; int pakfire_log_file_create(struct pakfire_log_file** file, - struct pakfire_ctx* ctx, const char* path, const char* filename, int flags); + pakfire_ctx* ctx, const char* path, const char* filename, int flags); struct pakfire_log_file* pakfire_log_file_ref(struct pakfire_log_file* self); struct pakfire_log_file* pakfire_log_file_unref(struct pakfire_log_file* self); diff --git a/src/pakfire/log_stream.c b/src/pakfire/log_stream.c index 7cb8f12f5..fcf0969a7 100644 --- a/src/pakfire/log_stream.c +++ b/src/pakfire/log_stream.c @@ -35,7 +35,7 @@ #define MAX_BUFFER_LENGTH 1024576 // 1 MiB struct pakfire_log_stream { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Pipe @@ -67,7 +67,7 @@ static void pakfire_log_stream_free(struct pakfire_log_stream* stream) { free(stream); } -int pakfire_log_stream_create(struct pakfire_log_stream** stream, struct pakfire_ctx* ctx, +int pakfire_log_stream_create(struct pakfire_log_stream** stream, pakfire_ctx* ctx, pakfire_log_stream_callback callback, void* data) { struct pakfire_log_stream* s = NULL; int r; diff --git a/src/pakfire/log_stream.h b/src/pakfire/log_stream.h index 85ce212e2..083ec3e4d 100644 --- a/src/pakfire/log_stream.h +++ b/src/pakfire/log_stream.h @@ -29,10 +29,10 @@ struct pakfire_log_stream; -typedef int (*pakfire_log_stream_callback)(struct pakfire_ctx* ctx, +typedef int (*pakfire_log_stream_callback)(pakfire_ctx* ctx, void* data, const char* line, size_t length); -int pakfire_log_stream_create(struct pakfire_log_stream** stream, struct pakfire_ctx* ctx, +int pakfire_log_stream_create(struct pakfire_log_stream** stream, pakfire_ctx* ctx, pakfire_log_stream_callback callback, void* data); struct pakfire_log_stream* pakfire_log_stream_ref(struct pakfire_log_stream* stream); struct pakfire_log_stream* pakfire_log_stream_unref(struct pakfire_log_stream* stream); diff --git a/src/pakfire/logging.h b/src/pakfire/logging.h index 862005b29..e8a98eafd 100644 --- a/src/pakfire/logging.h +++ b/src/pakfire/logging.h @@ -45,7 +45,7 @@ void pakfire_log_syslog(void* data, int priority, const char* file, // This function does absolutely nothing static inline void __attribute__((always_inline, format(printf, 2, 3))) - pakfire_ctx_log_null(struct pakfire_ctx* ctx, const char *format, ...) {} + pakfire_ctx_log_null(pakfire_ctx* ctx, const char *format, ...) {} #define INFO(ctx, arg...) pakfire_ctx_log_condition(ctx, LOG_INFO, ## arg) #define WARN(ctx, arg...) pakfire_ctx_log_condition(ctx, LOG_WARNING, ## arg) diff --git a/src/pakfire/mirror.c b/src/pakfire/mirror.c index 30a200c34..038bfca24 100644 --- a/src/pakfire/mirror.c +++ b/src/pakfire/mirror.c @@ -29,7 +29,7 @@ #define MIRROR_RETRIES 3 struct pakfire_mirror { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; char url[PATH_MAX]; @@ -49,7 +49,7 @@ static void pakfire_mirror_free(struct pakfire_mirror* mirror) { } int pakfire_mirror_create(struct pakfire_mirror** mirror, - struct pakfire_ctx* ctx, const char* url) { + pakfire_ctx* ctx, const char* url) { struct pakfire_mirror* m = NULL; int r; diff --git a/src/pakfire/mirror.h b/src/pakfire/mirror.h index 754f54248..e38d4094b 100644 --- a/src/pakfire/mirror.h +++ b/src/pakfire/mirror.h @@ -27,7 +27,7 @@ struct pakfire_mirror; #include int pakfire_mirror_create(struct pakfire_mirror** mirror, - struct pakfire_ctx* ctx, const char* url); + pakfire_ctx* ctx, const char* url); struct pakfire_mirror* pakfire_mirror_ref(struct pakfire_mirror* mirror); struct pakfire_mirror* pakfire_mirror_unref(struct pakfire_mirror* mirror); diff --git a/src/pakfire/mirrorlist.c b/src/pakfire/mirrorlist.c index 10016b39a..06233d9cf 100644 --- a/src/pakfire/mirrorlist.c +++ b/src/pakfire/mirrorlist.c @@ -30,7 +30,7 @@ #include struct pakfire_mirrorlist { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Mirrors @@ -58,7 +58,7 @@ static void pakfire_mirrorlist_free(struct pakfire_mirrorlist* list) { free(list); } -int pakfire_mirrorlist_create(struct pakfire_mirrorlist** list, struct pakfire_ctx* ctx) { +int pakfire_mirrorlist_create(struct pakfire_mirrorlist** list, pakfire_ctx* ctx) { struct pakfire_mirrorlist* l = NULL; // Allocate a new list diff --git a/src/pakfire/mirrorlist.h b/src/pakfire/mirrorlist.h index a37822828..999a864bb 100644 --- a/src/pakfire/mirrorlist.h +++ b/src/pakfire/mirrorlist.h @@ -26,7 +26,7 @@ struct pakfire_mirrorlist; #include #include -int pakfire_mirrorlist_create(struct pakfire_mirrorlist** list, struct pakfire_ctx* ctx); +int pakfire_mirrorlist_create(struct pakfire_mirrorlist** list, pakfire_ctx* ctx); struct pakfire_mirrorlist* pakfire_mirrorlist_ref(struct pakfire_mirrorlist* list); struct pakfire_mirrorlist* pakfire_mirrorlist_unref(struct pakfire_mirrorlist* list); diff --git a/src/pakfire/mount.c b/src/pakfire/mount.c index 7b65cd340..ddfa502fa 100644 --- a/src/pakfire/mount.c +++ b/src/pakfire/mount.c @@ -261,7 +261,7 @@ static const struct pakfire_symlink { { NULL }, }; -int pakfire_mount_change_propagation(struct pakfire_ctx* ctx, const char* path, int propagation) { +int pakfire_mount_change_propagation(pakfire_ctx* ctx, const char* path, int propagation) { DEBUG(ctx, "Changing mount propagation on %s\n", path); int r = mount(NULL, path, NULL, propagation|MS_REC, NULL); @@ -271,12 +271,12 @@ int pakfire_mount_change_propagation(struct pakfire_ctx* ctx, const char* path, return r; } -static int pakfire_mount_is_mountpoint(struct pakfire_ctx* ctx, const char* path) { +static int pakfire_mount_is_mountpoint(pakfire_ctx* ctx, const char* path) { // XXX THIS STILL NEEDS TO BE IMPLEMENTED return 1; } -int pakfire_mount_make_mounpoint(struct pakfire_ctx* ctx, const char* path) { +int pakfire_mount_make_mounpoint(pakfire_ctx* ctx, const char* path) { int r; // Check if path already is a mountpoint @@ -305,7 +305,7 @@ int pakfire_mount_make_mounpoint(struct pakfire_ctx* ctx, const char* path) { return 0; } -static int pakfire_mount(struct pakfire_ctx* ctx, const char* source, const char* target, +static int pakfire_mount(pakfire_ctx* ctx, const char* source, const char* target, const char* fstype, unsigned long mflags, const void* data) { const char* options = (const char*)data; @@ -327,7 +327,7 @@ static int pakfire_mount(struct pakfire_ctx* ctx, const char* source, const char } static int __pakfire_mount_list(char* line, size_t length, void* data) { - struct pakfire_ctx* ctx = data; + pakfire_ctx* ctx = data; // Send the line to the logger DEBUG(ctx, " %.*s", (int)length, line); @@ -335,13 +335,13 @@ static int __pakfire_mount_list(char* line, size_t length, void* data) { return 0; } -int pakfire_mount_list(struct pakfire_ctx* ctx) { +int pakfire_mount_list(pakfire_ctx* ctx) { DEBUG(ctx, "Mountpoints:\n"); return pakfire_parse_file("/proc/self/mounts", __pakfire_mount_list, ctx); } -int pakfire_populate_dev(struct pakfire_ctx* ctx, struct pakfire* pakfire, int flags) { +int pakfire_populate_dev(pakfire_ctx* ctx, struct pakfire* pakfire, int flags) { char path[PATH_MAX]; // Create device nodes @@ -406,7 +406,7 @@ MOUNT: return 0; } -int pakfire_mount_interpreter(struct pakfire_ctx* ctx, struct pakfire* pakfire) { +int pakfire_mount_interpreter(pakfire_ctx* ctx, struct pakfire* pakfire) { char target[PATH_MAX]; // Fetch the target architecture @@ -444,7 +444,7 @@ int pakfire_mount_interpreter(struct pakfire_ctx* ctx, struct pakfire* pakfire) return r; } -int pakfire_mount_all(struct pakfire_ctx* ctx, struct pakfire* pakfire, pakfire_mntns_t ns, int flags) { +int pakfire_mount_all(pakfire_ctx* ctx, struct pakfire* pakfire, pakfire_mntns_t ns, int flags) { char target[PATH_MAX]; int r; @@ -481,7 +481,7 @@ int pakfire_mount_all(struct pakfire_ctx* ctx, struct pakfire* pakfire, pakfire_ return 0; } -int pakfire_bind(struct pakfire_ctx* ctx, struct pakfire* pakfire, +int pakfire_bind(pakfire_ctx* ctx, struct pakfire* pakfire, const char* src, const char* dst, int flags) { struct stat st; char mountpoint[PATH_MAX]; diff --git a/src/pakfire/mount.h b/src/pakfire/mount.h index fc50eb9c9..fc5db114c 100644 --- a/src/pakfire/mount.h +++ b/src/pakfire/mount.h @@ -29,24 +29,24 @@ typedef enum pakfire_mntns { PAKFIRE_MNTNS_OUTER = (2 << 0), } pakfire_mntns_t; -int pakfire_mount_change_propagation(struct pakfire_ctx* ctx, const char* path, int propagation); +int pakfire_mount_change_propagation(pakfire_ctx* ctx, const char* path, int propagation); -int pakfire_mount_make_mounpoint(struct pakfire_ctx* ctx, const char* path); +int pakfire_mount_make_mounpoint(pakfire_ctx* ctx, const char* path); -int pakfire_bind(struct pakfire_ctx* ctx, struct pakfire* pakfire, +int pakfire_bind(pakfire_ctx* ctx, struct pakfire* pakfire, const char* src, const char* dst, int flags); -int pakfire_mount_list(struct pakfire_ctx* ctx); +int pakfire_mount_list(pakfire_ctx* ctx); -int pakfire_populate_dev(struct pakfire_ctx* ctx, struct pakfire* pakfire, int flags); +int pakfire_populate_dev(pakfire_ctx* ctx, struct pakfire* pakfire, int flags); -int pakfire_mount_interpreter(struct pakfire_ctx* ctx, struct pakfire* pakfire); +int pakfire_mount_interpreter(pakfire_ctx* ctx, struct pakfire* pakfire); enum pakfire_mount_flags { PAKFIRE_MOUNT_LOOP_DEVICES = (1 << 0), }; -int pakfire_mount_all(struct pakfire_ctx* ctx, struct pakfire* pakfire, +int pakfire_mount_all(pakfire_ctx* ctx, struct pakfire* pakfire, pakfire_mntns_t ns, int flags); #endif /* PAKFIRE_MOUNT_H */ diff --git a/src/pakfire/oci.c b/src/pakfire/oci.c index 659083bbd..adecfe6b6 100644 --- a/src/pakfire/oci.c +++ b/src/pakfire/oci.c @@ -41,7 +41,7 @@ struct pakfire_oci_writer { // Context - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; // Pakfire struct pakfire* pakfire; diff --git a/src/pakfire/package.c b/src/pakfire/package.c index 787628649..2f17e269a 100644 --- a/src/pakfire/package.c +++ b/src/pakfire/package.c @@ -56,7 +56,7 @@ #include struct pakfire_package { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; @@ -222,7 +222,7 @@ int pakfire_package_create(struct pakfire_package** package, } // Fetch the context - struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); + pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // Allocate a new solvable Id id = pakfire_repo_add_solvable(repo); @@ -2296,7 +2296,7 @@ int pakfire_package_append_file(struct pakfire_package* pkg, const char* path) { } static int __pakfire_package_set_filelist( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_package* pkg = data; // Fetch the path @@ -2436,7 +2436,7 @@ ERROR: } static int __pakfire_package_add_json_filelist( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct json_object* filelist = data; int r; @@ -2508,7 +2508,7 @@ ERROR: return r; } -static int __pakfire_package_add_build_packages(struct pakfire_ctx* ctx, +static int __pakfire_package_add_build_packages(pakfire_ctx* ctx, struct pakfire_package* pkg, void* p) { struct json_object* object = (struct json_object*)p; int r; diff --git a/src/pakfire/packagelist.c b/src/pakfire/packagelist.c index 6d2d74262..d4e7c1bef 100644 --- a/src/pakfire/packagelist.c +++ b/src/pakfire/packagelist.c @@ -32,7 +32,7 @@ #include struct pakfire_packagelist { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; struct pakfire_package** packages; @@ -61,7 +61,7 @@ static void pakfire_packagelist_free(struct pakfire_packagelist* list) { free(list); } -int pakfire_packagelist_create(struct pakfire_packagelist** list, struct pakfire_ctx* ctx) { +int pakfire_packagelist_create(struct pakfire_packagelist** list, pakfire_ctx* ctx) { struct pakfire_packagelist* self = NULL; // Allocate some memory @@ -223,7 +223,7 @@ int pakfire_packagelist_import_solvables(struct pakfire_packagelist* self, } static int __pakfire_packagelist_has_path( - struct pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) { + pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) { const char* path = data; // Fetch the path where we would expect this package to be diff --git a/src/pakfire/packagelist.h b/src/pakfire/packagelist.h index a4e003b08..e653e8f2d 100644 --- a/src/pakfire/packagelist.h +++ b/src/pakfire/packagelist.h @@ -29,7 +29,7 @@ struct pakfire_packagelist; #include #include -int pakfire_packagelist_create(struct pakfire_packagelist** list, struct pakfire_ctx* ctx); +int pakfire_packagelist_create(struct pakfire_packagelist** list, pakfire_ctx* ctx); struct pakfire_packagelist* pakfire_packagelist_ref(struct pakfire_packagelist* list); struct pakfire_packagelist* pakfire_packagelist_unref(struct pakfire_packagelist* list); @@ -40,7 +40,7 @@ int pakfire_packagelist_add(struct pakfire_packagelist* list, struct pakfire_pac int pakfire_packagelist_add_list(struct pakfire_packagelist* self, struct pakfire_packagelist* other); typedef int (*pakfire_packagelist_walk_callback) - (struct pakfire_ctx* ctx, struct pakfire_package* pkg, void* p); + (pakfire_ctx* ctx, struct pakfire_package* pkg, void* p); enum pakfire_packagelist_walk_flags { PAKFIRE_PACKAGELIST_KEEPGOING = (1 << 0), diff --git a/src/pakfire/packager.c b/src/pakfire/packager.c index 5e9270bad..122688071 100644 --- a/src/pakfire/packager.c +++ b/src/pakfire/packager.c @@ -46,7 +46,7 @@ #include struct pakfire_packager { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; @@ -537,7 +537,7 @@ ERROR: } static int __pakfire_packager_add_files( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_packager* packager = data; return pakfire_packager_add_file(packager, file); diff --git a/src/pakfire/pakfire.c b/src/pakfire/pakfire.c index 4c50ce50d..57f32cdff 100644 --- a/src/pakfire/pakfire.c +++ b/src/pakfire/pakfire.c @@ -66,7 +66,7 @@ #include struct pakfire { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; char path[PATH_MAX]; @@ -972,7 +972,7 @@ ERROR: return r; } -int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx* ctx, +int pakfire_create(struct pakfire** pakfire, pakfire_ctx* ctx, struct pakfire_config* config, const char* path, const char* arch, int flags) { struct pakfire* p = NULL; int r; @@ -1185,7 +1185,7 @@ struct pakfire* pakfire_unref(struct pakfire* pakfire) { return NULL; } -struct pakfire_ctx* pakfire_get_ctx(struct pakfire* pakfire) { +pakfire_ctx* pakfire_get_ctx(struct pakfire* pakfire) { return pakfire_ctx_ref(pakfire->ctx); } @@ -1601,7 +1601,7 @@ int pakfire_whatprovides(struct pakfire* pakfire, const char* what, int flags, return 0; } -static int __pakfire_whatrequires(struct pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) { +static int __pakfire_whatrequires(pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) { struct pakfire_packagelist* reverse = NULL; struct pakfire_packagelist* list = data; int r; diff --git a/src/pakfire/pakfire.h b/src/pakfire/pakfire.h index cc1a8848f..3e2c062e9 100644 --- a/src/pakfire/pakfire.h +++ b/src/pakfire/pakfire.h @@ -57,7 +57,7 @@ enum pakfire_flags { typedef void (*pakfire_status_callback)(struct pakfire* pakfire, void* data, int progress, const char* status); -int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx* ctx, +int pakfire_create(struct pakfire** pakfire, pakfire_ctx* ctx, struct pakfire_config* config, const char* path, const char* arch, int flags); struct pakfire* pakfire_ref(struct pakfire* pakfire); @@ -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_get_ctx(struct pakfire* pakfire); +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 0e4155909..a99d06c03 100644 --- a/src/pakfire/parser.c +++ b/src/pakfire/parser.c @@ -52,7 +52,7 @@ static struct pakfire_parser_regexes { } regexes = {}; struct pakfire_parser { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; diff --git a/src/pakfire/parser/grammar.y b/src/pakfire/parser/grammar.y index 0fb2cf522..b51bbc199 100644 --- a/src/pakfire/parser/grammar.y +++ b/src/pakfire/parser/grammar.y @@ -22,7 +22,7 @@ %parse-param {yyscan_t* scanner} - {struct pakfire_ctx* ctx} + {pakfire_ctx* ctx} {struct pakfire* pakfire} {struct pakfire_parser** parser} {struct pakfire_parser* parent} @@ -77,7 +77,7 @@ enum operator { OP_EQUALS = 0, }; -static void yyerror(yyscan_t* scanner, struct pakfire_ctx* ctx, struct pakfire* pakfire, +static void yyerror(yyscan_t* scanner, pakfire_ctx* ctx, struct pakfire* pakfire, struct pakfire_parser** parser, struct pakfire_parser* parent, struct pakfire_parser_error** error, const char* s) { const struct pakfire_parser_state* state = yyget_extra(scanner); @@ -93,7 +93,7 @@ static void yyerror(yyscan_t* scanner, struct pakfire_ctx* ctx, struct pakfire* } } -static struct pakfire_parser* make_if_stmt(struct pakfire_ctx* ctx, const enum operator op, +static struct pakfire_parser* make_if_stmt(pakfire_ctx* ctx, const enum operator op, const char* val1, const char* val2, struct pakfire_parser* if_block, struct pakfire_parser* else_block); static int pakfire_parser_new_declaration( @@ -424,7 +424,7 @@ int pakfire_parser_parse_data(struct pakfire_parser* parent, const char* data, s }; // Fetch context - struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); + pakfire_ctx* ctx = pakfire_get_ctx(pakfire); #ifdef ENABLE_DEBUG DEBUG(ctx, "Parsing the following data (%zu):\n%.*s\n", len, (int)len, data); @@ -491,7 +491,7 @@ ERROR: return r; } -static struct pakfire_parser* make_if_stmt(struct pakfire_ctx* ctx, const enum operator op, +static struct pakfire_parser* make_if_stmt(pakfire_ctx* ctx, const enum operator op, const char* val1, const char* val2, struct pakfire_parser* if_block, struct pakfire_parser* else_block) { switch (op) { case OP_EQUALS: diff --git a/src/pakfire/problem.c b/src/pakfire/problem.c index 39551ec96..9cbdc70a2 100644 --- a/src/pakfire/problem.c +++ b/src/pakfire/problem.c @@ -33,7 +33,7 @@ #include struct pakfire_problem { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; diff --git a/src/pakfire/progress.c b/src/pakfire/progress.c index ff9c6e5af..c545136b4 100644 --- a/src/pakfire/progress.c +++ b/src/pakfire/progress.c @@ -28,7 +28,7 @@ #include struct pakfire_progress { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Title @@ -89,7 +89,7 @@ static void pakfire_progress_free(struct pakfire_progress* p) { free(p); } -static int pakfire_progress_default_start_callback(struct pakfire_ctx* ctx, +static int pakfire_progress_default_start_callback(pakfire_ctx* ctx, struct pakfire_progress* p, void* data, unsigned long int value) { // Fetch the title const char* title = pakfire_progress_get_title(p); @@ -102,7 +102,7 @@ static int pakfire_progress_default_start_callback(struct pakfire_ctx* ctx, } int pakfire_progress_create(struct pakfire_progress** progress, - struct pakfire_ctx* ctx, int flags, struct pakfire_progress* parent) { + pakfire_ctx* ctx, int flags, struct pakfire_progress* parent) { struct pakfire_progress* p = NULL; int r; diff --git a/src/pakfire/progress.h b/src/pakfire/progress.h index ebee0f3c7..edf3afa33 100644 --- a/src/pakfire/progress.h +++ b/src/pakfire/progress.h @@ -43,15 +43,15 @@ int pakfire_progress_has_flag(struct pakfire_progress* p, int flag); Callbacks */ typedef int (*pakfire_progress_start_callback) - (struct pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, unsigned long int value); + (pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, unsigned long int value); typedef int (*pakfire_progress_finish_callback) - (struct pakfire_ctx* ctx, struct pakfire_progress* progress, void* data); + (pakfire_ctx* ctx, struct pakfire_progress* progress, void* data); typedef int (*pakfire_progress_update_callback) - (struct pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, unsigned long int value); + (pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, unsigned long int value); typedef int (*pakfire_progress_status_callback) - (struct pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, const char* status); + (pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, const char* status); typedef void (*pakfire_progress_free_callback) - (struct pakfire_ctx* ctx, struct pakfire_progress* progress, void* data); + (pakfire_ctx* ctx, struct pakfire_progress* progress, void* data); void pakfire_progress_set_callback_data(struct pakfire_progress* p, void* data); @@ -75,7 +75,7 @@ time_t pakfire_progress_get_eta(struct pakfire_progress* p); double pakfire_progress_get_transfer_speed(struct pakfire_progress* p); int pakfire_progress_create(struct pakfire_progress** progress, - struct pakfire_ctx* ctx, int flags, struct pakfire_progress* parent); + pakfire_ctx* ctx, int flags, struct pakfire_progress* parent); struct pakfire_progress* pakfire_progress_ref(struct pakfire_progress* p); struct pakfire_progress* pakfire_progress_unref(struct pakfire_progress* p); diff --git a/src/pakfire/pty.c b/src/pakfire/pty.c index 7f49f874c..351372c2b 100644 --- a/src/pakfire/pty.c +++ b/src/pakfire/pty.c @@ -63,7 +63,7 @@ struct pakfire_pty_stdio { }; struct pakfire_pty { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Event Loop @@ -1040,7 +1040,7 @@ static void pakfire_pty_free(struct pakfire_pty* pty) { free(pty); } -int pakfire_pty_create(struct pakfire_pty** pty, struct pakfire_ctx* ctx, sd_event* loop) { +int pakfire_pty_create(struct pakfire_pty** pty, pakfire_ctx* ctx, sd_event* loop) { struct pakfire_pty* p = NULL; int r; diff --git a/src/pakfire/pty.h b/src/pakfire/pty.h index 6abde7368..c4653f2ae 100644 --- a/src/pakfire/pty.h +++ b/src/pakfire/pty.h @@ -30,7 +30,7 @@ struct pakfire_pty; -int pakfire_pty_create(struct pakfire_pty** pty, struct pakfire_ctx* ctx, sd_event* loop); +int pakfire_pty_create(struct pakfire_pty** pty, pakfire_ctx* ctx, sd_event* loop); struct pakfire_pty* pakfire_pty_ref(struct pakfire_pty* pty); struct pakfire_pty* pakfire_pty_unref(struct pakfire_pty* pty); diff --git a/src/pakfire/pwd.c b/src/pakfire/pwd.c index 65afbcf5e..18526e21c 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_get_ctx(pakfire); + 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_get_ctx(pakfire); + 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_get_ctx(pakfire); + 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 3acaf3280..955d37d09 100644 --- a/src/pakfire/repo.c +++ b/src/pakfire/repo.c @@ -124,7 +124,7 @@ struct pakfire_repo_appdata { }; struct pakfire_repo { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; @@ -777,7 +777,7 @@ ERROR: return r; } -static int pakfire_repo_sync_remove(struct pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) { +static int pakfire_repo_sync_remove(pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) { int r; // Check if the package is available @@ -2567,7 +2567,7 @@ int pakfire_repo_compose(struct pakfire* pakfire, const char* path, } // Fetch context - struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire); + pakfire_ctx* ctx = pakfire_get_ctx(pakfire); // XXX Check if the key is a secret key @@ -2665,7 +2665,7 @@ ERROR: } int pakfire_repo_walk_packages(struct pakfire_repo* self, - int (*callback)(struct pakfire_ctx* ctx, struct pakfire_package* pkg, void* data), void* data, int flags) { + int (*callback)(pakfire_ctx* ctx, struct pakfire_package* pkg, void* data), void* data, int flags) { struct pakfire_packagelist* list = NULL; int r; @@ -2692,7 +2692,7 @@ struct pakfire_repo_walk_archives_state { }; static int __pakfire_repo_walk_archives( - struct pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) { + pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) { const struct pakfire_repo_walk_archives_state* state = data; struct pakfire_archive* archive = NULL; int r; diff --git a/src/pakfire/repo.h b/src/pakfire/repo.h index 3c703f63f..d6eb5cfde 100644 --- a/src/pakfire/repo.h +++ b/src/pakfire/repo.h @@ -149,10 +149,10 @@ Repodata* pakfire_repo_get_repodata(struct pakfire_repo* repo); struct pakfire_mirrorlist* pakfire_repo_get_mirrorlist(struct pakfire_repo* repo); int pakfire_repo_walk_packages(struct pakfire_repo* self, - int (*callback)(struct pakfire_ctx* ctx, struct pakfire_package* pkg, void* data), void* data, int flags); + int (*callback)(pakfire_ctx* ctx, struct pakfire_package* pkg, void* data), void* data, int flags); typedef int (*pakfire_repo_walk_archives_callback) - (struct pakfire_ctx* ctx, struct pakfire_package* pkg, struct pakfire_archive* archive, void* data); + (pakfire_ctx* ctx, struct pakfire_package* pkg, struct pakfire_archive* archive, void* data); int pakfire_repo_walk_archives(struct pakfire_repo* self, pakfire_repo_walk_archives_callback callback, void* data, int flags); diff --git a/src/pakfire/scriptlet.c b/src/pakfire/scriptlet.c index a29707e6a..eae5e7ac0 100644 --- a/src/pakfire/scriptlet.c +++ b/src/pakfire/scriptlet.c @@ -47,7 +47,7 @@ const char* pakfire_scriptlet_types[] = { }; struct pakfire_scriptlet { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Type @@ -96,7 +96,7 @@ static void pakfire_scriptlet_free(struct pakfire_scriptlet* scriptlet) { } int pakfire_scriptlet_create(struct pakfire_scriptlet** scriptlet, - struct pakfire_ctx* ctx, const char* type, const char* data, size_t size) { + pakfire_ctx* ctx, const char* type, const char* data, size_t size) { int r; // Check inputs diff --git a/src/pakfire/scriptlet.h b/src/pakfire/scriptlet.h index 94396b1f6..146fa96fc 100644 --- a/src/pakfire/scriptlet.h +++ b/src/pakfire/scriptlet.h @@ -29,7 +29,7 @@ extern const char* pakfire_scriptlet_types[13]; struct pakfire_scriptlet; int pakfire_scriptlet_create(struct pakfire_scriptlet** scriptlet, - struct pakfire_ctx* ctx, const char* type, const char* data, size_t size); + pakfire_ctx* ctx, const char* type, const char* data, size_t size); struct pakfire_scriptlet* pakfire_scriptlet_ref(struct pakfire_scriptlet* scriptlet); struct pakfire_scriptlet* pakfire_scriptlet_unref(struct pakfire_scriptlet* scriptlet); diff --git a/src/pakfire/snapshot.c b/src/pakfire/snapshot.c index 69568e287..609399333 100644 --- a/src/pakfire/snapshot.c +++ b/src/pakfire/snapshot.c @@ -41,7 +41,7 @@ #define PAKFIRE_SNAPSHOT_MAX_AGE 86400 // 24 hrs struct pakfire_snapshot { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Path @@ -78,7 +78,7 @@ static void pakfire_snapshot_free(struct pakfire_snapshot* self) { } int pakfire_snapshot_create( - struct pakfire_snapshot** snapshot, struct pakfire_ctx* ctx, const char* path) { + struct pakfire_snapshot** snapshot, pakfire_ctx* ctx, const char* path) { struct pakfire_snapshot* self = NULL; int r; @@ -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_get_ctx(pakfire); + 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_get_ctx(pakfire); + 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_get_ctx(pakfire); + pakfire_ctx* ctx = pakfire_get_ctx(pakfire); DEBUG(ctx, "Cleaning up snapshots...\n"); diff --git a/src/pakfire/snapshot.h b/src/pakfire/snapshot.h index f4b0ef197..fdce2b761 100644 --- a/src/pakfire/snapshot.h +++ b/src/pakfire/snapshot.h @@ -27,7 +27,7 @@ struct pakfire_snapshot; int pakfire_snapshot_create( - struct pakfire_snapshot** snapshot, struct pakfire_ctx* ctx, const char* path); + struct pakfire_snapshot** snapshot, pakfire_ctx* ctx, const char* path); struct pakfire_snapshot* pakfire_snapshot_ref(struct pakfire_snapshot* self); struct pakfire_snapshot* pakfire_snapshot_unref(struct pakfire_snapshot* self); diff --git a/src/pakfire/stripper.c b/src/pakfire/stripper.c index 4c62742e2..51d9ac264 100644 --- a/src/pakfire/stripper.c +++ b/src/pakfire/stripper.c @@ -37,7 +37,7 @@ #include struct pakfire_stripper { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Pakfire @@ -162,7 +162,7 @@ struct pakfire_stripper* pakfire_stripper_unref(struct pakfire_stripper* self) { } static int pakfire_stripper_find_elf( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_stripper* self = data; int r; @@ -210,7 +210,7 @@ ERROR: } static int pakfire_stripper_collect_sources( - struct pakfire_ctx* ctx, struct pakfire_elf* elf, const char* filename, void* data) { + pakfire_ctx* ctx, struct pakfire_elf* elf, const char* filename, void* data) { struct pakfire_stripper* self = data; struct pakfire_file* file = NULL; int r; @@ -241,7 +241,7 @@ ERROR: } static int pakfire_stripper_copy_sources( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_stripper* self = data; struct stat st = {}; char p[PATH_MAX]; @@ -520,7 +520,7 @@ ERROR: } static int pakfire_stripper_strip( - struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) { + pakfire_ctx* ctx, struct pakfire_file* file, void* data) { struct pakfire_stripper* self = data; struct pakfire_elf* elf = NULL; int r; diff --git a/src/pakfire/transaction.c b/src/pakfire/transaction.c index 7b746bb2e..ac0d5b3f9 100644 --- a/src/pakfire/transaction.c +++ b/src/pakfire/transaction.c @@ -46,7 +46,7 @@ #include struct pakfire_transaction { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; struct pakfire* pakfire; int nrefs; @@ -1780,7 +1780,7 @@ static int pakfire_transaction_open_archives( return 0; } -static int pakfire_usrmove_symlink(struct pakfire_ctx* ctx, struct pakfire* pakfire, +static int pakfire_usrmove_symlink(pakfire_ctx* ctx, struct pakfire* pakfire, const char* src, const char* dst) { char link[PATH_MAX]; char path[PATH_MAX]; @@ -1822,7 +1822,7 @@ static int pakfire_usrmove_symlink(struct pakfire_ctx* ctx, struct pakfire* pakf that /bin, /sbin, /lib and /lib64 are symlinks to their corresponding path in /usr. */ -static int pakfire_usrmove(struct pakfire_ctx* ctx, struct pakfire* pakfire) { +static int pakfire_usrmove(pakfire_ctx* ctx, struct pakfire* pakfire) { int r; r = pakfire_usrmove_symlink(ctx, pakfire, "/bin", "usr/bin"); diff --git a/src/pakfire/util.c b/src/pakfire/util.c index db66f6982..363c8a31d 100644 --- a/src/pakfire/util.c +++ b/src/pakfire/util.c @@ -284,7 +284,7 @@ char* pakfire_mkdtemp(char* path) { return mkdtemp(path); } -int pakfire_symlink(struct pakfire_ctx* ctx, const char* target, const char* linkpath) { +int pakfire_symlink(pakfire_ctx* ctx, const char* target, const char* linkpath) { char path[PATH_MAX]; int r; @@ -377,7 +377,7 @@ int __pakfire_which(struct pakfire* pakfire, char* path, const size_t length, // Resource Limits -int pakfire_rlimit_set(struct pakfire_ctx* ctx, int limit) { +int pakfire_rlimit_set(pakfire_ctx* ctx, int limit) { struct rlimit rl; int r; @@ -413,13 +413,13 @@ int pakfire_rlimit_set(struct pakfire_ctx* ctx, int limit) { Resets RLIMIT_NOFILE to FD_SETSIZE (e.g. 1024) for compatibility with software that uses select() */ -int pakfire_rlimit_reset_nofile(struct pakfire_ctx* ctx) { +int pakfire_rlimit_reset_nofile(pakfire_ctx* ctx) { return pakfire_rlimit_set(ctx, FD_SETSIZE); } // Regex -int pakfire_compile_regex(struct pakfire_ctx* ctx, pcre2_code** regex, const char* pattern) { +int pakfire_compile_regex(pakfire_ctx* ctx, pcre2_code** regex, const char* pattern) { int pcre2_errno; size_t pcre2_offset; PCRE2_UCHAR errmsg[256]; @@ -448,7 +448,7 @@ int pakfire_compile_regex(struct pakfire_ctx* ctx, pcre2_code** regex, const cha // Copy -int pakfire_copy(struct pakfire_ctx* ctx, FILE* src, FILE* dst) { +int pakfire_copy(pakfire_ctx* ctx, FILE* src, FILE* dst) { char buffer[BUFFER_SIZE]; size_t bytes_read; size_t bytes_written; @@ -478,7 +478,7 @@ int pakfire_copy(struct pakfire_ctx* ctx, FILE* src, FILE* dst) { return 0; } -int pakfire_fd_set_non_blocking(struct pakfire_ctx* ctx, int fd) { +int pakfire_fd_set_non_blocking(pakfire_ctx* ctx, int fd) { int flags; int r; diff --git a/src/pakfire/util.h b/src/pakfire/util.h index 79ca2dbab..5151c7fc9 100644 --- a/src/pakfire/util.h +++ b/src/pakfire/util.h @@ -64,7 +64,7 @@ int pakfire_mkparentdir(const char* path, mode_t mode); int pakfire_mkdir(const char* path, mode_t mode); FILE* pakfire_mktemp(char* path, const mode_t mode); char* pakfire_mkdtemp(char* path); -int pakfire_symlink(struct pakfire_ctx* ctx, const char* target, const char* linkpath); +int pakfire_symlink(pakfire_ctx* ctx, const char* target, const char* linkpath); int pakfire_rmtree(const char* path, int flags); #define pakfire_which(pakfire, path, what) \ @@ -80,18 +80,18 @@ char* pakfire_generate_uuid(void); #define PAKFIRE_RLIMIT_NOFILE_MAX (512 * 1024) -int pakfire_rlimit_set(struct pakfire_ctx* ctx, int limit); -int pakfire_rlimit_reset_nofile(struct pakfire_ctx* ctx); +int pakfire_rlimit_set(pakfire_ctx* ctx, int limit); +int pakfire_rlimit_reset_nofile(pakfire_ctx* ctx); // Regex -int pakfire_compile_regex(struct pakfire_ctx* ctx, pcre2_code** regex, const char* pattern); +int pakfire_compile_regex(pakfire_ctx* ctx, pcre2_code** regex, const char* pattern); // Copy -int pakfire_copy(struct pakfire_ctx* ctx, FILE* src, FILE* dst); +int pakfire_copy(pakfire_ctx* ctx, FILE* src, FILE* dst); // File Descriptors -int pakfire_fd_set_non_blocking(struct pakfire_ctx* ctx, int fd); +int pakfire_fd_set_non_blocking(pakfire_ctx* ctx, int fd); // Time diff --git a/src/pakfire/xfer.c b/src/pakfire/xfer.c index e759070b7..31ee39041 100644 --- a/src/pakfire/xfer.c +++ b/src/pakfire/xfer.c @@ -42,7 +42,7 @@ #include struct pakfire_xfer { - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; int nrefs; // Reference to the progress indicator @@ -188,7 +188,7 @@ static void pakfire_xfer_free(struct pakfire_xfer* xfer) { #ifdef ENABLE_DEBUG static int pakfire_xfer_debug_callback(CURL *handle, curl_infotype type, char* data, size_t size, void* private) { - struct pakfire_ctx* ctx = private; + pakfire_ctx* ctx = private; switch (type) { case CURLINFO_TEXT: @@ -348,11 +348,11 @@ ERROR: } static int __pakfire_xfer_create_simple(struct pakfire_xfer** xfer, - struct pakfire_ctx* ctx, const char* url, ...) __attribute__((format(printf, 3, 4))); + pakfire_ctx* ctx, const char* url, ...) __attribute__((format(printf, 3, 4))); // A helper function to create va_list static int __pakfire_xfer_create_simple( - struct pakfire_xfer** xfer, struct pakfire_ctx* ctx, const char* url, ...) { + struct pakfire_xfer** xfer, pakfire_ctx* ctx, const char* url, ...) { va_list args; int r; @@ -367,12 +367,12 @@ static int __pakfire_xfer_create_simple( } int pakfire_xfer_create_simple( - struct pakfire_xfer** xfer, struct pakfire_ctx* ctx, const char* url) { + struct pakfire_xfer** xfer, pakfire_ctx* ctx, const char* url) { return __pakfire_xfer_create_simple(xfer, ctx, "%s", url); } int pakfire_xfer_create(struct pakfire_xfer** xfer, - struct pakfire_ctx* ctx, const char* url, va_list args) { + pakfire_ctx* ctx, const char* url, va_list args) { struct pakfire_xfer* x = NULL; int r; diff --git a/src/pakfire/xfer.h b/src/pakfire/xfer.h index 342c63969..c659650bc 100644 --- a/src/pakfire/xfer.h +++ b/src/pakfire/xfer.h @@ -95,9 +95,9 @@ typedef enum pakfire_transfer_method { } pakfire_xfer_method_t; int pakfire_xfer_create_simple( - struct pakfire_xfer** xfer, struct pakfire_ctx* ctx, const char* url); + struct pakfire_xfer** xfer, pakfire_ctx* ctx, const char* url); -int pakfire_xfer_create(struct pakfire_xfer** xfer, struct pakfire_ctx* ctx, +int pakfire_xfer_create(struct pakfire_xfer** xfer, pakfire_ctx* ctx, const char* url, va_list args) __attribute__((format(printf, 3, 0))); struct pakfire_xfer* pakfire_xfer_ref(struct pakfire_xfer* xfer); diff --git a/src/python/ctx.c b/src/python/ctx.c index a3f22d0a7..e34385059 100644 --- a/src/python/ctx.c +++ b/src/python/ctx.c @@ -228,7 +228,7 @@ static PyObject* Ctx_set_logger(CtxObject* self, PyObject* args) { // Confirm Callback -static int Ctx_confirm_callback(struct pakfire_ctx* ctx, struct pakfire* pakfire, +static int Ctx_confirm_callback(pakfire_ctx* ctx, struct pakfire* pakfire, void* data, const char* message, const char* question) { PyObject* callback = data; PyObject* ret = NULL; @@ -280,7 +280,7 @@ static PyObject* Ctx_set_confirm_callback(CtxObject* self, PyObject* args) { // Progress Callback -static int Ctx_progress_start(struct pakfire_ctx* ctx, +static int Ctx_progress_start(pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, unsigned long int value) { PyObject* ret = NULL; PyObject* p = data; @@ -315,7 +315,7 @@ ERROR: return r; } -static int Ctx_progress_finish(struct pakfire_ctx* ctx, +static int Ctx_progress_finish(pakfire_ctx* ctx, struct pakfire_progress* progress, void* data) { PyObject* ret = NULL; PyObject* p = data; @@ -347,7 +347,7 @@ ERROR: return r; } -static int Ctx_progress_update(struct pakfire_ctx* ctx, +static int Ctx_progress_update(pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, unsigned long int value) { PyObject* ret = NULL; PyObject* p = data; @@ -379,7 +379,7 @@ ERROR: return r; } -static int Ctx_progress_status(struct pakfire_ctx* ctx, +static int Ctx_progress_status(pakfire_ctx* ctx, struct pakfire_progress* progress, void* data, const char* text) { PyObject* ret = NULL; PyObject* p = data; @@ -412,7 +412,7 @@ ERROR: } static void Ctx_progress_free( - struct pakfire_ctx* ctx, struct pakfire_progress* progress, void* data) { + pakfire_ctx* ctx, struct pakfire_progress* progress, void* data) { PyObject* p = data; // Acquire the GIL @@ -426,7 +426,7 @@ static void Ctx_progress_free( } static int Ctx_progress_callback( - struct pakfire_ctx* ctx, void* data, struct pakfire_progress* progress) { + pakfire_ctx* ctx, void* data, struct pakfire_progress* progress) { PyObject* callback = data; PyObject* p = NULL; int r = -1; diff --git a/src/python/ctx.h b/src/python/ctx.h index c5a0e3a88..1e9c473f6 100644 --- a/src/python/ctx.h +++ b/src/python/ctx.h @@ -27,7 +27,7 @@ typedef struct { PyObject_HEAD - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; PyObject* logger; diff --git a/src/python/pakfire.c b/src/python/pakfire.c index 54226fef4..8e1b606da 100644 --- a/src/python/pakfire.c +++ b/src/python/pakfire.c @@ -539,7 +539,7 @@ struct Pakfire_execute_output { PyObject* stderr; }; -static int Pakfire_execute_stdout_callback(struct pakfire_ctx* ctx, void* data, +static int Pakfire_execute_stdout_callback(pakfire_ctx* ctx, void* data, const enum pakfire_jail_output_stream stream, const char* line, const size_t length) { struct Pakfire_execute_output* output = data; PyObject* chunk = NULL; diff --git a/tests/libpakfire/jail.c b/tests/libpakfire/jail.c index 241bd7207..7b878b822 100644 --- a/tests/libpakfire/jail.c +++ b/tests/libpakfire/jail.c @@ -325,7 +325,7 @@ FAIL: return r; } -static ssize_t callback_stdin(struct pakfire_ctx* ctx, void* data, char* buffer, size_t length) { +static ssize_t callback_stdin(pakfire_ctx* ctx, void* data, char* buffer, size_t length) { int* lines = (int*)data; ssize_t bytes_written; @@ -348,7 +348,7 @@ static ssize_t callback_stdin(struct pakfire_ctx* ctx, void* data, char* buffer, } // Just consume the entire line -static int callback_stdout(struct pakfire_ctx* ctx, void* data, +static int callback_stdout(pakfire_ctx* ctx, void* data, const enum pakfire_jail_output_stream stream, const char* line, size_t length) { return fwrite(line, 1, length, stdout); } @@ -444,7 +444,7 @@ FAIL: return r; } -static int __callback(struct pakfire_ctx* ctx, void* data) { +static int __callback(pakfire_ctx* ctx, void* data) { int* i = data; // Log a message diff --git a/tests/libpakfire/log_stream.c b/tests/libpakfire/log_stream.c index 8591af140..c12f7f3fb 100644 --- a/tests/libpakfire/log_stream.c +++ b/tests/libpakfire/log_stream.c @@ -23,7 +23,7 @@ #include "../testsuite.h" -static int log_callback(struct pakfire_ctx* ctx, +static int log_callback(pakfire_ctx* ctx, void* data, const char* line, size_t length) { int* lines_read = data; diff --git a/tests/parser/test.c b/tests/parser/test.c index 99aa11037..e21621f63 100644 --- a/tests/parser/test.c +++ b/tests/parser/test.c @@ -27,7 +27,7 @@ int main(int argc, const char* argv[]) { struct pakfire_config* config = NULL; - struct pakfire_ctx* ctx = NULL; + pakfire_ctx* ctx = NULL; struct pakfire* pakfire = NULL; struct pakfire_parser* parser = NULL; struct pakfire_parser_error* error = NULL; diff --git a/tests/testsuite.c b/tests/testsuite.c index f61a3a53e..f7cb59fea 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -35,7 +35,7 @@ struct testsuite ts; static int test_run(int i, struct test* t) { - struct pakfire_ctx* ctx = NULL; + pakfire_ctx* ctx = NULL; struct pakfire* p = NULL; int r; diff --git a/tests/testsuite.h b/tests/testsuite.h index 648bc8c0c..940e72bcb 100644 --- a/tests/testsuite.h +++ b/tests/testsuite.h @@ -49,7 +49,7 @@ struct test { struct pakfire_config* config; // Pakfire Context - struct pakfire_ctx* ctx; + pakfire_ctx* ctx; // Pakfire struct pakfire* pakfire;