format: let clang-format run ._.

(won't even talk about clang-tidy)
This commit is contained in:
2024-09-05 20:26:58 +02:00
parent b34528d1cb
commit dbbab78e23
12 changed files with 142 additions and 135 deletions

View File

@@ -45,72 +45,72 @@ bool line_parser(FILE *fd, ssize_t *blksize,
struct config *__config;
u_char config_line_handler(char *k, char *v) {
if(strcmp(k, "colors.bg") == 0)
if (strcmp(k, "colors.bg") == 0)
__config->theme.colors.bg = v;
else if(strcmp(k, "colors.fg") == 0)
else if (strcmp(k, "colors.fg") == 0)
__config->theme.colors.fg = v;
else if(strcmp(k, "colors.err") == 0)
else if (strcmp(k, "colors.err") == 0)
__config->theme.colors.err = v;
else if(strcmp(k, "colors.s_wl") == 0)
else if (strcmp(k, "colors.s_wl") == 0)
__config->theme.colors.s_wl = v;
else if(strcmp(k, "colors.s_xorg") == 0)
else if (strcmp(k, "colors.s_xorg") == 0)
__config->theme.colors.s_xorg = v;
else if(strcmp(k, "colors.s_shell") == 0)
else if (strcmp(k, "colors.s_shell") == 0)
__config->theme.colors.s_shell = v;
else if(strcmp(k, "colors.f_other") == 0)
else if (strcmp(k, "colors.f_other") == 0)
__config->theme.colors.f_other = v;
else if(strcmp(k, "colors.e_hostname") == 0)
else if (strcmp(k, "colors.e_hostname") == 0)
__config->theme.colors.e_hostname = v;
else if(strcmp(k, "colors.e_date") == 0)
else if (strcmp(k, "colors.e_date") == 0)
__config->theme.colors.e_date = v;
else if(strcmp(k, "colors.e_box") == 0)
else if (strcmp(k, "colors.e_box") == 0)
__config->theme.colors.e_box = v;
else if(strcmp(k, "colors.e_header") == 0)
else if (strcmp(k, "colors.e_header") == 0)
__config->theme.colors.e_header = v;
else if(strcmp(k, "colors.e_user") == 0)
else if (strcmp(k, "colors.e_user") == 0)
__config->theme.colors.e_user = v;
else if(strcmp(k, "colors.e_passwd") == 0)
else if (strcmp(k, "colors.e_passwd") == 0)
__config->theme.colors.e_passwd = v;
else if(strcmp(k, "colors.e_badpasswd") == 0)
else if (strcmp(k, "colors.e_badpasswd") == 0)
__config->theme.colors.e_badpasswd = v;
else if(strcmp(k, "colors.e_key") == 0)
else if (strcmp(k, "colors.e_key") == 0)
__config->theme.colors.e_key = v;
else if(strcmp(k, "chars.hb") == 0)
else if (strcmp(k, "chars.hb") == 0)
__config->theme.chars.hb = v;
else if(strcmp(k, "chars.vb") == 0)
else if (strcmp(k, "chars.vb") == 0)
__config->theme.chars.vb = v;
else if(strcmp(k, "chars.ctl") == 0)
else if (strcmp(k, "chars.ctl") == 0)
__config->theme.chars.ctl = v;
else if(strcmp(k, "chars.ctr") == 0)
else if (strcmp(k, "chars.ctr") == 0)
__config->theme.chars.ctr = v;
else if(strcmp(k, "chars.cbl") == 0)
else if (strcmp(k, "chars.cbl") == 0)
__config->theme.chars.cbl = v;
else if(strcmp(k, "chars.cbr") == 0)
else if (strcmp(k, "chars.cbr") == 0)
__config->theme.chars.cbr = v;
else if(strcmp(k, "functions.poweroff") == 0)
else if (strcmp(k, "functions.poweroff") == 0)
__config->functions.poweroff = find_keyname(v);
else if(strcmp(k, "functions.reboot") == 0)
else if (strcmp(k, "functions.reboot") == 0)
__config->functions.reboot = find_keyname(v);
else if(strcmp(k, "functions.refresh") == 0)
else if (strcmp(k, "functions.refresh") == 0)
__config->functions.refresh = find_keyname(v);
else if(strcmp(k, "strings.f_poweroff") == 0)
__config->strings.f_poweroff= v;
else if(strcmp(k, "strings.f_reboot") == 0)
__config->strings.f_reboot= v;
else if(strcmp(k, "strings.f_refresh") == 0)
__config->strings.f_refresh= v;
else if(strcmp(k, "strings.e_user") == 0)
__config->strings.e_user= v;
else if(strcmp(k, "strings.e_passwd") == 0)
__config->strings.e_passwd= v;
else if(strcmp(k, "strings.s_xorg") == 0)
__config->strings.s_xorg= v;
else if(strcmp(k, "strings.s_wayland") == 0)
__config->strings.s_wayland= v;
else if(strcmp(k, "strings.s_shell") == 0)
__config->strings.s_shell= v;
else if(strcmp(k, "behavior.include_defshell") == 0)
__config->behavior.include_defshell= strcmp(v, "true") == 0;
else if (strcmp(k, "strings.f_poweroff") == 0)
__config->strings.f_poweroff = v;
else if (strcmp(k, "strings.f_reboot") == 0)
__config->strings.f_reboot = v;
else if (strcmp(k, "strings.f_refresh") == 0)
__config->strings.f_refresh = v;
else if (strcmp(k, "strings.e_user") == 0)
__config->strings.e_user = v;
else if (strcmp(k, "strings.e_passwd") == 0)
__config->strings.e_passwd = v;
else if (strcmp(k, "strings.s_xorg") == 0)
__config->strings.s_xorg = v;
else if (strcmp(k, "strings.s_wayland") == 0)
__config->strings.s_wayland = v;
else if (strcmp(k, "strings.s_shell") == 0)
__config->strings.s_shell = v;
else if (strcmp(k, "behavior.include_defshell") == 0)
__config->behavior.include_defshell = strcmp(v, "true") == 0;
else
return 0b1111;
@@ -128,7 +128,7 @@ struct config *parse_config(char *path) {
__config = malloc(sizeof(struct config));
if (__config == NULL)
return NULL;
bool ret = line_parser(fd, (ssize_t*)&sb.st_blksize, config_line_handler);
bool ret = line_parser(fd, (ssize_t *)&sb.st_blksize, config_line_handler);
if (!ret) {
free(__config);
return NULL;