From 75bdd2ad3ccbf217a89dab98a040fe41c10deca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 12 Jan 2019 10:32:52 +0100 Subject: [PATCH] config: use dashes, '-', instead of underscores, '_' in attribute names --- CMakeLists.txt | 2 +- config-verify.c | 26 ++++++++++---------- config.c | 4 +-- particles/{progress_bar.c => progress-bar.c} | 2 +- particles/{progress_bar.h => progress-bar.h} | 0 5 files changed, 17 insertions(+), 17 deletions(-) rename particles/{progress_bar.c => progress-bar.c} (99%) rename particles/{progress_bar.h => progress-bar.h} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0a0619..9d2853a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ add_executable(f00bar particles/empty.c particles/empty.h particles/list.c particles/list.h particles/map.c particles/map.h - particles/progress_bar.c particles/progress_bar.h + particles/progress-bar.c particles/progress-bar.h particles/ramp.c particles/ramp.h particles/string.c particles/string.h diff --git a/config-verify.c b/config-verify.c index 4e7f08e..4ac6c63 100644 --- a/config-verify.c +++ b/config-verify.c @@ -334,9 +334,9 @@ verify_particle_dictionary(keychain_t *chain, const struct yml_node *node) #define COMMON_ATTRS \ {"margin", false, &verify_int}, \ - {"left_margin", false, &verify_int}, \ - {"right_margin", false, &verify_int}, \ - {"on_click", false, &verify_string}, + {"left-margin", false, &verify_int}, \ + {"right-margin", false, &verify_int}, \ + {"on-click", false, &verify_string}, static const struct attr_info empty[] = { COMMON_ATTRS @@ -345,8 +345,8 @@ verify_particle_dictionary(keychain_t *chain, const struct yml_node *node) static const struct attr_info list[] = { {"items", true, &verify_list_items}, {"spacing", false, &verify_int}, - {"left_spacing", false, &verify_int}, - {"right_spacing", false, &verify_int}, + {"left-spacing", false, &verify_int}, + {"right-spacing", false, &verify_int}, COMMON_ATTRS }; @@ -394,7 +394,7 @@ verify_particle_dictionary(keychain_t *chain, const struct yml_node *node) {"empty", empty, sizeof(empty) / sizeof(empty[0])}, {"list", list, sizeof(list) / sizeof(list[0])}, {"map", map, sizeof(map) / sizeof(map[0])}, - {"progress_bar", progress_bar, sizeof(progress_bar) / sizeof(progress_bar[0])}, + {"progress-bar", progress_bar, sizeof(progress_bar) / sizeof(progress_bar[0])}, {"ramp", ramp, sizeof(ramp) / sizeof(ramp[0])}, {"string", string, sizeof(string) / sizeof(string[0])}, }; @@ -496,7 +496,7 @@ verify_module(keychain_t *chain, const struct yml_node *node) static const struct attr_info battery[] = { {"name", true, &verify_string}, - {"poll_interval", false, &verify_int}, + {"poll-interval", false, &verify_int}, {"content", true, &verify_particle}, {"anchors", false, NULL}, }; @@ -522,8 +522,8 @@ verify_module(keychain_t *chain, const struct yml_node *node) static const struct attr_info i3[] = { {"spacing", false, &verify_int}, - {"left_spacing", false, &verify_int}, - {"right_spacing", false, &verify_int}, + {"left-spacing", false, &verify_int}, + {"right-spacing", false, &verify_int}, {"content", true, &verify_i3_content}, {"anchors", false, NULL}, }; @@ -536,8 +536,8 @@ verify_module(keychain_t *chain, const struct yml_node *node) static const struct attr_info removables[] = { {"spacing", false, &verify_int}, - {"left_spacing", false, &verify_int}, - {"right_spacing", false, &verify_int}, + {"left-spacing", false, &verify_int}, + {"right-spacing", false, &verify_int}, {"content", true, &verify_particle}, {"anchors", false, NULL}, }; @@ -641,8 +641,8 @@ config_verify_bar(const struct yml_node *bar) {"background", true, &verify_color}, {"spacing", false, &verify_int}, - {"left_spacing", false, &verify_int}, - {"right_spacing", false, &verify_int}, + {"left-spacing", false, &verify_int}, + {"right-spacing", false, &verify_int}, {"margin", false, &verify_int}, {"left_margin", false, &verify_int}, diff --git a/config.c b/config.c index 01e79db..fcedfef 100644 --- a/config.c +++ b/config.c @@ -16,7 +16,7 @@ #include "particles/empty.h" #include "particles/list.h" #include "particles/map.h" -#include "particles/progress_bar.h" +#include "particles/progress-bar.h" #include "particles/ramp.h" #include "particles/string.h" @@ -351,7 +351,7 @@ particle_from_config(const struct yml_node *node, const struct font *parent_font else if (strcmp(type, "ramp") == 0) ret = particle_ramp_from_config( pair.value, parent_font, left, right, on_click_template); - else if (strcmp(type, "progress_bar") == 0) + else if (strcmp(type, "progress-bar") == 0) ret = particle_progress_bar_from_config( pair.value, parent_font, left, right, on_click_template); else diff --git a/particles/progress_bar.c b/particles/progress-bar.c similarity index 99% rename from particles/progress_bar.c rename to particles/progress-bar.c index cd4362b..88b4f2a 100644 --- a/particles/progress_bar.c +++ b/particles/progress-bar.c @@ -1,4 +1,4 @@ -#include "progress_bar.h" +#include "progress-bar.h" #include #include diff --git a/particles/progress_bar.h b/particles/progress-bar.h similarity index 100% rename from particles/progress_bar.h rename to particles/progress-bar.h