]> git.ipfire.org Git - pakfire.git/commitdiff
util: Move pakfire_action_type_string to steps
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Apr 2021 16:07:14 +0000 (16:07 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Apr 2021 16:07:14 +0000 (16:07 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/util.h
src/libpakfire/step.c
src/libpakfire/util.c

index d6522ecd2167f46b4827fb338f8885614604dc69..9e6c2d44b5362ee90c5b94302226934062537681 100644 (file)
@@ -46,8 +46,6 @@ int pakfire_access(Pakfire pakfire, const char* dir, const char* file, int mode)
 char* pakfire_sgets(char* str, int num, char** input);
 char* pakfire_remove_trailing_newline(char* str);
 
-const char* pakfire_action_type_string(pakfire_action_type_t type);
-
 int pakfire_read_file_into_buffer(FILE* f, char** buffer, size_t* len);
 
 size_t pakfire_string_to_size(const char* s);
index 3a6f8bb2094a4e2e5430aff0baeba77dc3b14ee0..b8682bd8463b5819eded7f86c231cdb5619c4ddc 100644 (file)
@@ -308,6 +308,28 @@ static int pakfire_step_erase(PakfireStep step) {
        return 0; // TODO
 }
 
+
+static const char* pakfire_action_type_string(pakfire_action_type_t type) {
+       switch (type) {
+               case PAKFIRE_ACTION_NOOP:
+                       return "NOOP";
+
+               case PAKFIRE_ACTION_VERIFY:
+                       return "VERIFY";
+
+               case PAKFIRE_ACTION_EXECUTE:
+                       return "EXECUTE";
+
+               case PAKFIRE_ACTION_PRETRANS:
+                       return "PRETRANS";
+
+               case PAKFIRE_ACTION_POSTTRANS:
+                       return "POSTTRANS";
+       }
+
+       return NULL;
+}
+
 PAKFIRE_EXPORT int pakfire_step_run(PakfireStep step,
                struct pakfire_db* db, const pakfire_action_type_t action) {
        DEBUG(step->pakfire, "Running Step %p (%s)\n", step, pakfire_action_type_string(action));
index f8dc415edb7fc1a997369cfb5bf72f6ac9de1cb1..e80520b69550b709d22388a861b5e51c58ac8b1b 100644 (file)
@@ -362,27 +362,6 @@ char* pakfire_remove_trailing_newline(char* str) {
        return str;
 }
 
-PAKFIRE_EXPORT const char* pakfire_action_type_string(pakfire_action_type_t type) {
-       switch (type) {
-               case PAKFIRE_ACTION_NOOP:
-                       return "NOOP";
-
-               case PAKFIRE_ACTION_VERIFY:
-                       return "VERIFY";
-
-               case PAKFIRE_ACTION_EXECUTE:
-                       return "EXECUTE";
-
-               case PAKFIRE_ACTION_PRETRANS:
-                       return "PRETRANS";
-
-               case PAKFIRE_ACTION_POSTTRANS:
-                       return "POSTTRANS";
-       }
-
-       return NULL;
-}
-
 PAKFIRE_EXPORT int pakfire_read_file_into_buffer(FILE* f, char** buffer, size_t* len) {
        if (!f)
                return -EBADF;