Add comments to functions.
This commit is contained in:
21
src/config.c
21
src/config.c
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user