Add comments to functions.

This commit is contained in:
gamemann
2021-11-12 17:30:35 +00:00
parent becaeb4b34
commit bcfaccb71e
3 changed files with 58 additions and 0 deletions

View File

@@ -11,6 +11,13 @@
FILE *file;
/**
* Sets the config structure's default values.
*
* @param cfg A pointer to the config structure.
*
* @return Void
*/
void setcfgdefaults(struct config *cfg)
{
cfg->updatetime = 0;
@@ -74,6 +81,13 @@ void setcfgdefaults(struct config *cfg)
}
}
/**
* Opens the config file.
*
* @param filename Path to config file.
*
* @return 0 on success or 1 on error.
*/
int opencfg(const char *filename)
{
// Close any existing files.
@@ -94,6 +108,13 @@ int opencfg(const char *filename)
return 0;
}
/**
* Read the config file and stores values in config structure.
*
* @param cfg A pointer to the config structure.
*
* @return 0 on success or 1/-1 on error.
*/
int readcfg(struct config *cfg)
{
// Not sure why this would be set to NULL after checking for it in OpenConfig(), but just for safety.