[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 8/8] Remove cfg_foreach
From: |
Ladislav Michl |
Subject: |
[PATCH 8/8] Remove cfg_foreach |
Date: |
Tue, 4 Dec 2018 22:28:31 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
cfg_foreach is no longer used, so remove it.
---
common/cfgreader.c | 23 -----------------------
include/gnokii-internal.h | 2 --
2 files changed, 25 deletions(-)
diff --git a/common/cfgreader.c b/common/cfgreader.c
index 5204f82d..d440daf7 100644
--- a/common/cfgreader.c
+++ b/common/cfgreader.c
@@ -651,29 +651,6 @@ int cfg_section_exists(struct gn_cfg_header *cfg, const
char *section)
return false;
}
-/*
- * Return all the entries of the given section.
- */
-void cfg_foreach(const char *section, cfg_foreach_func func)
-{
- struct gn_cfg_header *h;
- struct gn_cfg_entry *e;
- struct gn_cfg_header *cfg = gn_cfg_info;
-
- 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);
- }
- }
-}
-
/* Set the value of a key in a config file. Return the new value if
the section/key can be found, else return NULL. */
char *cfg_set(struct gn_cfg_header *cfg, const char *section, const char *key,
diff --git a/include/gnokii-internal.h b/include/gnokii-internal.h
index e02e44ea..75e4ccaa 100644
--- a/include/gnokii-internal.h
+++ b/include/gnokii-internal.h
@@ -154,8 +154,6 @@ int sms_nokia_text_encode(unsigned char *text, unsigned
char *message, bool firs
int sms_nokia_bitmap_encode(gn_bmp *bitmap, unsigned char *message, bool
first);
struct gn_cfg_header *cfg_file_read(const char *filename);
-typedef void (*cfg_foreach_func)(const char *section, const char *key, const
char *value);
-void cfg_foreach(const char *section, cfg_foreach_func func);
char *cfg_set(struct gn_cfg_header *cfg, const char *section, const char *key,
const char *value);
int cfg_file_write(struct gn_cfg_header *cfg, const char *filename);
/* Get some information about the given phone */
--
2.20.0.rc2
[PATCH v2 4/8] Test for number of mkdir() arguments, Ladislav Michl, 2018/12/04
[PATCH 8/8] Remove cfg_foreach,
Ladislav Michl <=
[PATCH v2 6/8] Refactor devices build, Ladislav Michl, 2018/12/04
[PATCH v2 7/8] Use posix_spawn to run external scripts, Ladislav Michl, 2018/12/04
[PATCH 5/8] Fix compat.c compilation with mingw32, Ladislav Michl, 2018/12/04