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;
#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;
#include <pakfire/config.h>
#include <pakfire/ctx.h>
-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);
#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;
#include <pakfire/ctx.h>
-int cli_daemon_main(struct pakfire_ctx* ctx);
+int cli_daemon_main(pakfire_ctx* ctx);
#endif /* PAKFIRE_CLI_DAEMON_H */
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
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);
#define MAX_REPOS 16
struct cli_global_args {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
const char* distro;
const char* config;
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;
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;
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;
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;
#include <pakfire/ctx.h>
#include <pakfire/progress.h>
-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 */
}
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;
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;
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;
}
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;
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 */
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)
}
int main(int argc, char* argv[]) {
- struct pakfire_ctx* ctx = NULL;
+ pakfire_ctx* ctx = NULL;
int r;
// Setup the context
}
int main(int argc, char* argv[]) {
- struct pakfire_ctx* ctx = NULL;
+ pakfire_ctx* ctx = NULL;
int r;
// Setup the context
};
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:
}
int main(int argc, char* argv[]) {
- struct pakfire_ctx* ctx = NULL;
+ pakfire_ctx* ctx = NULL;
int r;
// Initialize changing the process title
int main(int argc, char* argv[]) {
- struct pakfire_ctx* ctx = NULL;
+ pakfire_ctx* ctx = NULL;
int r;
// Setup the context
#define ARCHIVE_READ_BLOCK_SIZE 512 * 1024
struct pakfire_archive {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
}
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;
#include <pakfire/string.h>
struct pakfire_archive_writer {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Pakfire
}
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;
}
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;
#include <pakfire/ctx.h>
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;
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);
};
struct pakfire_build {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
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;
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;
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;
}
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
}
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;
}
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;
}
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;
}
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;
}
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];
}
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;
}
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;
*/
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
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;
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;
}
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;
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;
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;
}
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;
}
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
}
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;
}
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:
}
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;
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;
}
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);
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;
}
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);
}
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;
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);
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);
struct pakfire_builder {
// Context
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
// Reference Counter
int nrefs;
}
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;
#include <pakfire/xfer.h>
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);
})
struct pakfire_cgroup {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// The parent group
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;
}
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;
}
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;
};
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);
};
struct pakfire_client {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Event Loop
}
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;
#include <pakfire/xfer.h>
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);
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
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);
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;
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);
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
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;
// 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;
// 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;
// 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;
// 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)
// 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;
// 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;
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");
}
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");
&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
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
// 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
#ifndef PAKFIRE_CTX_H
#define PAKFIRE_CTX_H
-struct pakfire_ctx;
+typedef struct pakfire_ctx pakfire_ctx;
#include <pakfire/config.h>
#include <pakfire/logging.h>
#include <pakfire/progress.h>
#include <pakfire/transaction.h>
-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
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 <systemd/sd-event.h>
-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 <curl/curl.h>
-CURLSH* pakfire_ctx_curl_share(struct pakfire_ctx* self);
+CURLSH* pakfire_ctx_curl_share(pakfire_ctx* self);
// Magic
#include <magic.h>
-magic_t pakfire_ctx_magic(struct pakfire_ctx* self);
+magic_t pakfire_ctx_magic(pakfire_ctx* self);
#endif /* PAKFIRE_CTX_H */
#include <pakfire/util.h>
struct pakfire_daemon {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Pakfire Client
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;
#include <pakfire/ctx.h>
-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);
#define SCHEMA_MIN_SUP 7
struct pakfire_db {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
};
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);
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);
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;
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;
}
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];
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;
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];
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);
#include <elfutils/libdwelf.h>
struct pakfire_elf {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Path
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));
}
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;
}
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;
#include <pakfire/file.h>
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);
// 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);
#define ENVIRON_SIZE 128
struct pakfire_env {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
char* env[ENVIRON_SIZE];
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
#include <pakfire/ctx.h>
-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);
};
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;
}
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:
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)
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);
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))
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;
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 */
};
struct pakfire_file {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
#include <pakfire/util.h>
struct pakfire_filelist {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
}
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
}
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);
}
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);
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),
#include <pakfire/hashes.h>
struct pakfire_hasher {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Selected hashes
}
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;
/*
* 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;
/*
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];
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;
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);
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 */
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;
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;
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;
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;
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 */
};
struct pakfire_httpclient {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Flags
}
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;
#include <pakfire/xfer.h>
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);
};
struct pakfire_jail {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
/*
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);
}
#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);
}
#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
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
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;
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)
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;
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;
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);
// 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),
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
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 */
#include <pakfire/util.h>
struct pakfire_job {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Builder
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;
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;
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;
}
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;
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;
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);
#define ERROR_MAX 1024
struct pakfire_key {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Algorithm
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;
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;
*/
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;
}
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;
}
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;
}
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;
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);
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 */
#include <pakfire/string.h>
struct pakfire_linter_file {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Linter
}
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;
#include <pakfire/linter.h>
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);
};
struct pakfire_linter {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Pakfire
}
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
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);
};
struct pakfire_log_buffer {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
STAILQ_HEAD(lines, pakfire_log_line) lines;
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
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);
#define MAX_LINE_LENGTH 4096
struct pakfire_log_file {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Filename
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;
};
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);
#define MAX_BUFFER_LENGTH 1024576 // 1 MiB
struct pakfire_log_stream {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Pipe
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;
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);
// 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)
#define MIRROR_RETRIES 3
struct pakfire_mirror {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
char url[PATH_MAX];
}
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;
#include <pakfire/xfer.h>
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);
#include <pakfire/util.h>
struct pakfire_mirrorlist {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Mirrors
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
#include <pakfire/ctx.h>
#include <pakfire/mirror.h>
-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);
{ 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);
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
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;
}
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);
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
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
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;
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];
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 */
struct pakfire_oci_writer {
// Context
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
// Pakfire
struct pakfire* pakfire;
#include <pakfire/util.h>
struct pakfire_package {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
}
// 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);
}
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
}
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;
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;
#include <pakfire/util.h>
struct pakfire_packagelist {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
struct pakfire_package** packages;
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
}
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
#include <pakfire/package.h>
#include <pakfire/pakfire.h>
-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);
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),
#include <pakfire/util.h>
struct pakfire_packager {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
}
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);
#include <pakfire/util.h>
struct pakfire {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
char path[PATH_MAX];
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;
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);
}
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;
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);
// 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);
} regexes = {};
struct pakfire_parser {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
%parse-param
{yyscan_t* scanner}
- {struct pakfire_ctx* ctx}
+ {pakfire_ctx* ctx}
{struct pakfire* pakfire}
{struct pakfire_parser** parser}
{struct pakfire_parser* parent}
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);
}
}
-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(
};
// 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);
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:
#include <pakfire/util.h>
struct pakfire_problem {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
#include <pakfire/string.h>
struct pakfire_progress {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Title
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);
}
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;
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);
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);
};
struct pakfire_pty {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Event Loop
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;
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);
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) {
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) {
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);
};
struct pakfire_repo {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
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
}
// 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
}
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;
};
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;
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);
};
struct pakfire_scriptlet {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Type
}
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
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);
#define PAKFIRE_SNAPSHOT_MAX_AGE 86400 // 24 hrs
struct pakfire_snapshot {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Path
}
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;
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");
NULL,
};
- struct pakfire_ctx* ctx = pakfire_get_ctx(pakfire);
+ pakfire_ctx* ctx = pakfire_get_ctx(pakfire);
// Fetch the configuration
config = pakfire_get_config(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");
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);
#include <pakfire/util.h>
struct pakfire_stripper {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Pakfire
}
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;
}
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;
}
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];
}
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;
#include <pakfire/util.h>
struct pakfire_transaction {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
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];
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");
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;
// 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;
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];
// 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;
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;
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) \
#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
#include <pakfire/xfer.h>
struct pakfire_xfer {
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
int nrefs;
// Reference to the progress indicator
#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:
}
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;
}
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;
} 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);
// 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;
// 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;
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;
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;
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;
}
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
}
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;
typedef struct {
PyObject_HEAD
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
PyObject* logger;
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;
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;
}
// 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);
}
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
#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;
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;
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;
struct pakfire_config* config;
// Pakfire Context
- struct pakfire_ctx* ctx;
+ pakfire_ctx* ctx;
// Pakfire
struct pakfire* pakfire;