![]() |
GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Utility functions for application config files. More...
Go to the source code of this file.
Functions | |
| char * | gp_app_cfg_path (const char *app_name, const char *cfg_filename) |
| Prepares a path to a config file. | |
| int | gp_app_cfg_mkpath (const char *app_name) |
| Creates a path for a config files, if it does not exists. | |
| int | gp_app_cfg_scanf (const char *app_name, const char *cfg_filename, const char *fmt,...) |
| Does a single scanf() from a config file. | |
| int | gp_app_cfg_printf (const char *app_name, const char *cfg_filename, const char *fmt,...) |
| Does a simple printf() to a config file. | |
Utility functions for application config files.
Definition in file gp_app_cfg.h.
| int gp_app_cfg_mkpath | ( | const char * | app_name | ) |
Creates a path for a config files, if it does not exists.
The path is constructed as "$HOME/.config/$APP_NAME/".
Works exactly the same as 'mkdir -p'.
| app_name | An application name |
| char * gp_app_cfg_path | ( | const char * | app_name, |
| const char * | cfg_filename ) |
Prepares a path to a config file.
The path is constructed as "$HOME/.config/$APP_NAME/$CFG_FILENAME".
| app_name | An application name |
| cfg_filename | A config filename |
| int gp_app_cfg_printf | ( | const char * | app_name, |
| const char * | cfg_filename, | ||
| const char * | fmt, | ||
| ... ) |
Does a simple printf() to a config file.
Simplified interface for cases when we can write the config with single printf.
| app_name | An application name |
| cfg_filename | A config filename |
| fmt | A printf format string |
| ... | A printf parameters |
| int gp_app_cfg_scanf | ( | const char * | app_name, |
| const char * | cfg_filename, | ||
| const char * | fmt, | ||
| ... ) |
Does a single scanf() from a config file.
Simplified interface for cases when we can read the config with single scanf.
| app_name | An application name |
| cfg_filename | A config filename |
| fmt | A scanf format string |
| ... | A scanf parameters |