]> git.ipfire.org Git - pakfire.git/commitdiff
compress: Swap PAKFIRE_WALK_DONE and *_END for semantic reasons
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 Mar 2023 16:10:02 +0000 (16:10 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 Mar 2023 16:35:35 +0000 (16:35 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/archive.c
src/libpakfire/compress.c
src/libpakfire/include/pakfire/compress.h

index f1e43c5ca809c99b3e3a381d1e49ef97b2a9f35d..a7df2fef23a77be43afd16a167577eacfa445059 100644 (file)
@@ -372,7 +372,7 @@ static int __pakfire_archive_filter_metadata(struct pakfire* pakfire,
                        return PAKFIRE_WALK_OK;
 
                // Otherwise, the payload begins
-               return PAKFIRE_WALK_DONE;
+               return PAKFIRE_WALK_END;
 
        // The pakfire-format file is part of the metadata
        } else if (strcmp(path, "pakfire-format") == 0) {
@@ -548,9 +548,9 @@ static int __pakfire_archive_filter_payload(struct pakfire* pakfire,
                case '.':
                        return PAKFIRE_WALK_SKIP;
 
-               // The first file that isn't metadata was found, so we can end here
+               // The first file that isn't metadata, so we are done calling the filter callback
                default:
-                       return PAKFIRE_WALK_END;
+                       return PAKFIRE_WALK_DONE;
        }
 }
 
index 5d66474a7e17f6cd6c1fb8f91627635a7957332e..b956e2aec20d7b676fb73c02fdeb2198de0a67f3 100644 (file)
@@ -561,16 +561,16 @@ int pakfire_walk(struct pakfire* pakfire, struct archive* archive,
                                case PAKFIRE_WALK_OK:
                                        break;
 
-                               case PAKFIRE_WALK_DONE:
-                                       DEBUG(pakfire, "Filter callback sent DONE\n");
+                               case PAKFIRE_WALK_END:
+                                       DEBUG(pakfire, "Filter callback sent END\n");
                                        return 0;
 
                                case PAKFIRE_WALK_SKIP:
                                        DEBUG(pakfire, "Filter callback sent SKIP\n");
                                        continue;
 
-                               case PAKFIRE_WALK_END:
-                                       DEBUG(pakfire, "Filter callback sent END\n");
+                               case PAKFIRE_WALK_DONE:
+                                       DEBUG(pakfire, "Filter callback sent DONE\n");
 
                                        // Clear the callback function
                                        filter_callback = NULL;
index ce6e760fcb2d1ef47d67814fadacd86cc3634abd..d7a0f1b7e50acd4834d86889733ce8b6bdade640 100644 (file)
@@ -48,13 +48,13 @@ enum pakfire_walk_codes {
        PAKFIRE_WALK_ERROR = 1,
 
        // After this code has been sent, we will not process any further entries
-       PAKFIRE_WALK_DONE  = -10,
+       PAKFIRE_WALK_END   = -10,
 
        // Request the next entry (only in filter callback)
        PAKFIRE_WALK_SKIP  = -20,
 
        // Like PAKFIRE_WALK_OK, but the callback will not be called again
-       PAKFIRE_WALK_END   = -30,
+       PAKFIRE_WALK_DONE  = -30,
 };
 
 int pakfire_walk(struct pakfire* pakfire, struct archive* archive,