dwm-libconfig 6.8
Runtime configuration parsing for dwm using libconfig.
Loading...
Searching...
No Matches
Todo List
Global _parse_rules_config (const config_t *config, Rule **array, unsigned int *count, bool *malloced)
Check for NULL pointers from function arguments. Possible able to use lookup_path in logs instead of repeating message
Global _parse_setting_array (const config_setting_t *setting, const size_t element_size, const Array_Element_Parser_Function_t array_element_parser_function, bool *malloced, void **parsed_config, unsigned int *parsed_config_length)

It may be worth trying to add some kind of safeguard to fall back on default config if enough elements fail to be parsed. For example, if the keybinds all (or many) fail, it could soft-lock the user in the program. Not sure best way to do that, or if it is even the best idea to add.

The logic around malloced and null checking parsed_config before allocation is brittle, needs work.

Global _parser_open_config_file (config_t *config, const char *custom_config_filepath, char **found_config_filepath, bool *fallback_config_loaded)

These error returns may not be the most accurate, not sure exactly the best fits.

Should the parser even look for another config file if one is passed from the CLI? Could be deceptive behavior.

Global Error_t
Maybe look at adding ERROR_ARGUMENT, as we check function arguments a ton.
Global parse_config (void)

Polish the status texts a little. I like the idea but could be refined.

Backup config file logic is clumsily structured, it should be improved. It also probably should include rules_malloced

File parser.c

Finish documentation. Make sure function arguments are noted for being dynamically allocated in that function or its sub functions.

Overhaul printing / logging to match the new error handling.

Try and reduce the number of unique string literals throughout the parser. Tons are used for logging, inflating binary size by 8kb.