const char* pakfire_solution_to_string(struct pakfire_solution* solution);
+#ifdef PAKFIRE_PRIVATE
+
+struct pakfire_problem* pakfire_solution_get_problem(struct pakfire_solution* solution);
+Id pakfire_solution_get_id(struct pakfire_solution* solution);
+
+#endif /* PAKFIRE_PRIVATE */
+
#endif /* PAKFIRE_SOLUTION_H */
pakfire_request_ref;
pakfire_request_solve;
pakfire_request_sync;
+ pakfire_request_take_solution;
pakfire_request_upgrade;
pakfire_request_upgrade_all;
pakfire_request_upgrade_package;
return 0;
}
+
+PAKFIRE_EXPORT int pakfire_request_take_solution(struct pakfire_request* request,
+ struct pakfire_solution* solution) {
+ struct pakfire_problem* problem = pakfire_solution_get_problem(solution);
+
+ // Fetch IDs
+ Id problem_id = pakfire_problem_get_id(problem);
+ Id solution_id = pakfire_solution_get_id(solution);
+
+ // Feed the solution into the solver
+ solver_take_solution(request->solver, problem_id, solution_id, &request->jobs);
+
+ pakfire_problem_unref(problem);
+ return 0;
+}
return NULL;
}
+struct pakfire_problem* pakfire_solution_get_problem(struct pakfire_solution* solution) {
+ return pakfire_problem_ref(solution->problem);
+}
+
+Id pakfire_solution_get_id(struct pakfire_solution* solution) {
+ return solution->id;
+}
+
static char* pakfire_solution_make_string(struct pakfire_solution* solution) {
struct pakfire_request* request = pakfire_problem_get_request(solution->problem);
Solver* solver = pakfire_request_get_solver(request);