+/*
+ * Return all the entries of the fiven section.
+ */
+
+void CFG_GetForeach(struct CFG_Header *cfg, const char *section, CFG_GetForeach_func func)
+{
+ struct CFG_Header *h;
+ struct CFG_Entry *e;
+
+ if ((cfg == NULL) || (section == NULL) || (func == NULL)) {
+ return;
+ }
+
+ /* Search for section name */
+ for (h = cfg; h != NULL; h = h->next) {
+ if (strcmp(section, h->section) == 0) {
+ /* Search for key within section */
+ for (e = h->entries; e != NULL; e = e->next)
+ (*func)(section,e->key,e->value);
+ }
+ }
+}
+