summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2009-03-11 10:38:31 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2009-03-11 10:38:31 +0000
commit1dfd48e25865933734dbd4c6e4eb498a166fc3cc (patch)
tree34ff2a40546e27acc351cc43b04fafb597454842
parenta8964b0ee99dad576a60540a2472598b65c86eef (diff)
function pointer typedef to work around some va_arg limitations
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@486 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--gconfig.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gconfig.c b/gconfig.c
index 5f16b8c..ce0ce01 100644
--- a/gconfig.c
+++ b/gconfig.c
@@ -383,6 +383,8 @@ void unhex(char *s) {
*s = '\0';
}
+typedef int (*t_fptr)(struct gconffile **, void *, char *, char *, char *);
+
/* returns 1 if ok, 0 on error */
/* caller must free returned values also on error */
int getgenericconfig(struct gconffile **cf, char *block, ...) {
@@ -391,7 +393,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) {
uint8_t *bln = NULL;
long int *lint = NULL;
int type = 0, conftype = 0, n;
- int (*cbk)(struct gconffile **, void *, char *, char *, char *) = NULL;
+ t_fptr cbk = NULL;
void *cbkarg = NULL;
for (;;) {
@@ -435,7 +437,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) {
goto errparam;
break;
case CONF_CBK:
- cbk = va_arg(ap, int (*)(struct gconffile **, void *, char *, char *, char *));
+ cbk = va_arg(ap, t_fptr);
if (!cbk)
goto errparam;
cbkarg = va_arg(ap, void *);