break;
// Create a new solution
- r = pakfire_solution_create(&solution, problem->root, problem, id);
+ r = pakfire_solution_create(&solution, problem->ctx, problem, id);
if (r)
goto ERROR;
#include <solv/policy.h>
#include <pakfire/constants.h>
+#include <pakfire/ctx.h>
#include <pakfire/i18n.h>
#include <pakfire/logging.h>
#include <pakfire/root.h>
#include <pakfire/util.h>
struct pakfire_solution {
- pakfire_root* root;
+ pakfire_ctx* ctx;
int nrefs;
pakfire_problem* problem;
};
int pakfire_solution_create(pakfire_solution** solution,
- pakfire_root* root, pakfire_problem* problem, Id id) {
+ pakfire_ctx* ctx, pakfire_problem* problem, Id id) {
pakfire_solution* s = calloc(1, sizeof(*s));
if (!s)
return -errno;
- // Store a reference to the root
- s->root = pakfire_root_ref(root);
+ // Store a reference to the context
+ s->ctx = pakfire_ctx_ref(ctx);
// Initialize the ref counter
s->nrefs = 1;
if (solution->string)
free(solution->string);
-
- if (solution->root)
- pakfire_root_unref(solution->root);
+ if (solution->ctx)
+ pakfire_ctx_unref(solution->ctx);
free(solution);
}
typedef struct pakfire_solution pakfire_solution;
-#include <pakfire/root.h>
+#include <pakfire/ctx.h>
#include <pakfire/problem.h>
+int pakfire_solution_create(pakfire_solution** solution,
+ pakfire_ctx* ctx, pakfire_problem* problem, Id id);
+
pakfire_solution* pakfire_solution_ref(pakfire_solution* solution);
pakfire_solution* pakfire_solution_unref(pakfire_solution* solution);
const char* pakfire_solution_to_string(pakfire_solution* solution);
-int pakfire_solution_create(pakfire_solution** solution, pakfire_root* root,
- pakfire_problem* problem, Id id);
pakfire_problem* pakfire_solution_get_problem(pakfire_solution* solution);
Id pakfire_solution_get_id(pakfire_solution* solution);