diff options
Diffstat (limited to 'src/blocks/ram.c')
| -rw-r--r-- | src/blocks/ram.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/blocks/ram.c b/src/blocks/ram.c index 0536c26..4841860 100644 --- a/src/blocks/ram.c +++ b/src/blocks/ram.c @@ -21,13 +21,13 @@ typedef enum { RAM_USED_PERC, } block_ram_mark_t; -static const format_pair_t block_ram_pairs[] = { - { "total", RAM_TOTAL }, - { "free", RAM_FREE }, - { "used", RAM_USED }, - { "free-percentage", RAM_FREE_PERC }, - { "used-percentage", RAM_USED_PERC }, - { NULL }, +static const format_option_t block_ram_options[] = { + { { "total", RAM_TOTAL } }, + { { "free", RAM_FREE } }, + { { "used", RAM_USED } }, + { { "free-percentage", RAM_FREE_PERC } }, + { { "used-percentage", RAM_USED_PERC } }, + { { NULL } }, }; static const struct timespec block_ram_interval = { @@ -74,9 +74,9 @@ static void block_ram_update(block_t *block) size_t rest = start >= size ? 0 : size - start; if (rest == 0) break; - switch (ram->format.marks[i]) { + switch (ram->format.parts[i].mark) { case RAM_STRING: - start += snprintf(buffer + start, rest, "%s", ram->format.parts[i]); + start += snprintf(buffer + start, rest, "%s", ram->format.parts[i].string); break; case RAM_TOTAL: start += snprintf(buffer + start, rest, "%ld", total); @@ -138,7 +138,7 @@ static bool block_ram_validate(block_t *block, const block_scheme_t *scheme) return false; } - int marked = format_remark(&ram->format, block->label, block_ram_pairs); + int marked = format_remark(&ram->format, block->label, block_ram_options); if (marked < 0) return false; |
