summaryrefslogtreecommitdiff
path: root/src/settings.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-03-01 15:03:08 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-03-01 15:03:08 +0100
commitd6764679ed3735714acae44c5cf529a9d047dc8b (patch)
tree236d718069aa7f41713c87f4dae7cab268ba8a42 /src/settings.c
parent152c67bb38e71c1b189774beac07008cbc4d1631 (diff)
downloadpianobar-windows-d6764679ed3735714acae44c5cf529a9d047dc8b.tar.gz
pianobar-windows-d6764679ed3735714acae44c5cf529a9d047dc8b.tar.bz2
pianobar-windows-d6764679ed3735714acae44c5cf529a9d047dc8b.zip
Even more documentation
...and small cleanups.
Diffstat (limited to 'src/settings.c')
-rw-r--r--src/settings.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c
index bc471f0..cd82b7c 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -59,10 +59,16 @@ void BarGetXdgConfigDir (const char *filename, char *retDir,
}
}
+/* initialize settings structure
+ * @param settings struct
+ */
void BarSettingsInit (BarSettings_t *settings) {
memset (settings, 0, sizeof (*settings));
}
+/* free settings structure, zero it afterwards
+ * @oaram pointer to struct
+ */
void BarSettingsDestroy (BarSettings_t *settings) {
BarKeyShortcut_t *curShortcut = settings->keys, *lastShortcut;
@@ -86,6 +92,10 @@ void BarSettingsDestroy (BarSettings_t *settings) {
memset (settings, 0, sizeof (*settings));
}
+/* copy key shortcut into settings structure
+ * @param shortcut to be copied
+ * @param destination settings structure
+ */
void BarSettingsAppendKey (BarKeyShortcut_t *shortcut,
BarSettings_t *settings) {
BarKeyShortcut_t *tmp = calloc (1, sizeof (*tmp));
@@ -99,6 +109,7 @@ void BarSettingsAppendKey (BarKeyShortcut_t *shortcut,
tmp->configKey = strdup (shortcut->configKey);
}
+ /* insert into linked list */
if (settings->keys == NULL) {
settings->keys = tmp;
} else {