diff options
| author | Jesper Jensen <jesper@jnsn.dev> | 2026-02-21 23:47:28 +0100 |
|---|---|---|
| committer | Jesper Jensen <jesper@jnsn.dev> | 2026-02-21 23:47:28 +0100 |
| commit | 0c817cc0ae9a6e1b66d6e6ff45fa80bacabc58a9 (patch) | |
| tree | 31b95a732c6523c4e0819cdcd129e0f4aed5eda8 /src/app.h | |
| parent | 3c59ccdbf77ca8f6f90dd0a1b6d1f0a833e6f2fb (diff) | |
Parse the status closer to the database
Diffstat (limited to 'src/app.h')
| -rw-r--r-- | src/app.h | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -6,9 +6,17 @@ #define CLIENT_NAME_MAX 32 #define CLIENT_SECRET_LEN 33 -#define BACKUP_STATUS_MAX 16 #define MAX_BACKUPS_DISPLAY 50 +enum BackupStatus { + STATUS_RUNNING, + STATUS_FINISHED, + STATUS_INTERRUPTED, +}; + +const char *backup_status_to_db_string(enum BackupStatus status); +enum BackupStatus backup_status_from_db_string(const char *str); + struct App { const char* dbname; char session_secret[CLIENT_SECRET_LEN]; @@ -32,7 +40,7 @@ struct ListClientResultClient { char name[CLIENT_NAME_MAX]; char secret[CLIENT_SECRET_LEN]; struct timespec last_backup; - char status[BACKUP_STATUS_MAX]; // "OK", "RUNNING", "STALE", "FAILED", "INTERRUPTED" + enum BackupStatus status; int is_stale; }; @@ -46,7 +54,7 @@ int list_clients(struct App *app, struct ListClientResult *result); struct BackupRecord { int64_t id; - char status[BACKUP_STATUS_MAX]; + enum BackupStatus status; struct timespec started; struct timespec completed; }; |
