aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/textfile.c3
-rw-r--r--src/textfile.h5
2 files changed, 4 insertions, 4 deletions
diff --git a/src/textfile.c b/src/textfile.c
index a62cfe73..2429cc70 100644
--- a/src/textfile.c
+++ b/src/textfile.c
@@ -373,8 +373,7 @@ char *textfile_caseget(const char *pathname, const char *key)
return read_key(pathname, key, 1);
}
-int textfile_foreach(const char *pathname,
- void (*func)(char *key, char *value, void *data), void *data)
+int textfile_foreach(const char *pathname, textfile_cb func, void *data)
{
struct stat st;
char *map, *off, *end, *key, *value;
diff --git a/src/textfile.h b/src/textfile.h
index 8353bc7a..dc5fc2b7 100644
--- a/src/textfile.h
+++ b/src/textfile.h
@@ -36,7 +36,8 @@ int textfile_casedel(const char *pathname, const char *key);
char *textfile_get(const char *pathname, const char *key);
char *textfile_caseget(const char *pathname, const char *key);
-int textfile_foreach(const char *pathname,
- void (*func)(char *key, char *value, void *data), void *data);
+typedef void (*textfile_cb) (char *key, char *value, void *data);
+
+int textfile_foreach(const char *pathname, textfile_cb func, void *data);
#endif /* __TEXTFILE_H */