From: Michael Tremer Date: Sat, 15 Mar 2025 10:44:45 +0000 (+0000) Subject: progress: Rename status to state X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08afea568e67dacf451f22ff1bfc0edf75b2a9ba;p=pakfire.git progress: Rename status to state Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/progress.c b/src/pakfire/progress.c index f581bea4..14084cd9 100644 --- a/src/pakfire/progress.c +++ b/src/pakfire/progress.c @@ -40,11 +40,11 @@ struct pakfire_progress { struct pakfire_progress* parent; // Status - enum pakfire_progress_status { + enum pakfire_progress_state { PAKFIRE_PROGRESS_INIT = 0, PAKFIRE_PROGRESS_RUNNING, PAKFIRE_PROGRESS_FINISHED, - } status; + } state; // Callbacks struct pakfire_progress_callbacks { @@ -114,7 +114,7 @@ int pakfire_progress_create(struct pakfire_progress** progress, p->flags = flags; // Initialize status - p->status = PAKFIRE_PROGRESS_INIT; + p->state = PAKFIRE_PROGRESS_INIT; // Store a reference to the parent if (parent) @@ -191,11 +191,11 @@ int pakfire_progress_start(struct pakfire_progress* p, unsigned long int value) int r; // This can only be called once - if (p->status == PAKFIRE_PROGRESS_RUNNING) + if (p->state == PAKFIRE_PROGRESS_RUNNING) return -EINVAL; // We are now running... - p->status = PAKFIRE_PROGRESS_RUNNING; + p->state = PAKFIRE_PROGRESS_RUNNING; // Store the max value p->max_value = value; @@ -224,7 +224,7 @@ int pakfire_progress_finish(struct pakfire_progress* p) { int r; // Do nothing if already finished - if (p->status == PAKFIRE_PROGRESS_FINISHED) + if (p->state == PAKFIRE_PROGRESS_FINISHED) return 0; // No-op @@ -280,7 +280,7 @@ int pakfire_progress_increment(struct pakfire_progress* p, unsigned long int val int pakfire_progress_reset(struct pakfire_progress* p) { int r; - switch (p->status) { + switch (p->state) { case PAKFIRE_PROGRESS_INIT: return 0; @@ -357,7 +357,7 @@ time_t pakfire_progress_get_elapsed_time(struct pakfire_progress* p) { struct timespec now; int r; - switch (p->status) { + switch (p->state) { case PAKFIRE_PROGRESS_INIT: return 0;