Split up CONFIGFILE_LOC into CONFIGFILE_DIR and CONFIGFILE_NAME The config UI needs to be able to create CONFIGFILE_DIR if it doesn't exist, so make this easier on it.
Move the regex #defines to configfile.c They're not needed anywhere else, so no need for them to be in the header file.
Add independent config file parsing functions Config file parsing will also be needed by the config UI, so break out into its own function so that it can be shared between the config UI and the C implementation.
Initial refactor of config file handling Move the config file locating code, the location #defines, and the parsing regexes into new files, so that they can be shared by the config UI.