From: Michael Tremer Date: Fri, 10 Mar 2023 16:10:02 +0000 (+0000) Subject: compress: Swap PAKFIRE_WALK_DONE and *_END for semantic reasons X-Git-Tag: 0.9.29~334 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2480e01836909caa0b6ea4b94da5d71d4a9fb036;p=pakfire.git compress: Swap PAKFIRE_WALK_DONE and *_END for semantic reasons Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/archive.c b/src/libpakfire/archive.c index f1e43c5ca..a7df2fef2 100644 --- a/src/libpakfire/archive.c +++ b/src/libpakfire/archive.c @@ -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; } } diff --git a/src/libpakfire/compress.c b/src/libpakfire/compress.c index 5d66474a7..b956e2aec 100644 --- a/src/libpakfire/compress.c +++ b/src/libpakfire/compress.c @@ -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; diff --git a/src/libpakfire/include/pakfire/compress.h b/src/libpakfire/include/pakfire/compress.h index ce6e760fc..d7a0f1b7e 100644 --- a/src/libpakfire/include/pakfire/compress.h +++ b/src/libpakfire/include/pakfire/compress.h @@ -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,