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 {
p->flags = flags;
// Initialize status
- p->status = PAKFIRE_PROGRESS_INIT;
+ p->state = PAKFIRE_PROGRESS_INIT;
// Store a reference to the parent
if (parent)
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;
int r;
// Do nothing if already finished
- if (p->status == PAKFIRE_PROGRESS_FINISHED)
+ if (p->state == PAKFIRE_PROGRESS_FINISHED)
return 0;
// No-op
int pakfire_progress_reset(struct pakfire_progress* p) {
int r;
- switch (p->status) {
+ switch (p->state) {
case PAKFIRE_PROGRESS_INIT:
return 0;
struct timespec now;
int r;
- switch (p->status) {
+ switch (p->state) {
case PAKFIRE_PROGRESS_INIT:
return 0;