]> git.ipfire.org Git - pakfire.git/commitdiff
problems: Drop linked list
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 24 Jun 2021 21:42:40 +0000 (21:42 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 24 Jun 2021 21:42:40 +0000 (21:42 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/problem.h
src/libpakfire/libpakfire.sym
src/libpakfire/problem.c

index b6028434874953b2323b24080fbb99b69dbb8e71..e5055bb80dda14c179e6f2062dc916bf122c7102 100644 (file)
@@ -32,9 +32,6 @@ int pakfire_problem_create(struct pakfire_problem** problem, struct pakfire_requ
 struct pakfire_problem* pakfire_problem_ref(struct pakfire_problem* problem);
 struct pakfire_problem* pakfire_problem_unref(struct pakfire_problem* problem);
 
-struct pakfire_problem* pakfire_problem_next(struct pakfire_problem* problem);
-void pakfire_problem_append(struct pakfire_problem* problem, struct pakfire_problem* new_problem);
-
 const char* pakfire_problem_to_string(struct pakfire_problem* problem);
 
 struct pakfire_request* pakfire_problem_get_request(struct pakfire_problem* problem);
index 2b3d9a009680ffe3eab486db8fefa24c90d60b3a..f70e30c87ba76e9e05bdf63a43288f7f0c1d7eab 100644 (file)
@@ -238,10 +238,8 @@ global:
        pakfire_parser_error_unref;
 
        # problem
-       pakfire_problem_append;
        pakfire_problem_create;
        pakfire_problem_get_solutions;
-       pakfire_problem_next;
        pakfire_problem_ref;
        pakfire_problem_to_string;
        pakfire_problem_unref;
index 56e514e4581102feaf899336ce736a2a209b3320..2ee8578597b51aeb4ca0bc1f38698047adf78da7 100644 (file)
 
 struct pakfire_problem {
        Pakfire pakfire;
+       int nrefs;
+
        struct pakfire_request* request;
        Id id;
        char* string;
-
-       struct pakfire_problem* next;
-       int nrefs;
 };
 
 static char* to_string(struct pakfire_problem* problem) {
@@ -230,7 +229,6 @@ PAKFIRE_EXPORT struct pakfire_problem* pakfire_problem_ref(struct pakfire_proble
 }
 
 static void pakfire_problem_free(struct pakfire_problem* problem) {
-       pakfire_problem_unref(problem->next);
        pakfire_request_unref(problem->request);
 
        if (problem->string)
@@ -255,21 +253,6 @@ Pakfire pakfire_problem_get_pakfire(struct pakfire_problem* problem) {
        return pakfire_ref(problem->pakfire);
 }
 
-PAKFIRE_EXPORT struct pakfire_problem* pakfire_problem_next(struct pakfire_problem* problem) {
-       return problem->next;
-}
-
-PAKFIRE_EXPORT void pakfire_problem_append(struct pakfire_problem* problem, struct pakfire_problem* new_problem) {
-       struct pakfire_problem* next;
-
-       // Go to last problem in list
-       while ((next = pakfire_problem_next(problem)) != NULL) {
-               problem = next;
-       }
-
-       problem->next = pakfire_problem_ref(new_problem);
-}
-
 PAKFIRE_EXPORT const char* pakfire_problem_to_string(struct pakfire_problem* problem) {
        return problem->string;
 }