aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2010-08-13 14:48:31 -0400
committerAnderson Lizardo <anderson.lizardo@openbossa.org>2010-08-26 09:29:56 -0400
commit05a3ffaf6ed7c01d2b05b1edebfbf810f3eb8fe2 (patch)
tree8e0d3b5b6cb8e244728a1cbc299fda2980376437
parent679e5b3c00a16985455fc7fee8002a9feb1996ef (diff)
downloadbluez-05a3ffaf6ed7c01d2b05b1edebfbf810f3eb8fe2.tar.gz
bluez-05a3ffaf6ed7c01d2b05b1edebfbf810f3eb8fe2.tar.xz
bluez-05a3ffaf6ed7c01d2b05b1edebfbf810f3eb8fe2.zip
Create typedef for textfile_foreach() callback
-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 */