@@ -33,7 +33,7 @@ static int line_nr;
int
keyword_alloc(vector keywords, char *string,
- int (*handler) (struct config *, vector),
+ handler_fn *handler,
print_fn *print,
int unique)
{
@@ -72,7 +72,7 @@ install_sublevel_end(void)
int
_install_keyword(vector keywords, char *string,
- int (*handler) (struct config *, vector),
+ handler_fn *handler,
print_fn *print,
int unique)
{
@@ -558,7 +558,7 @@ process_stream(struct config *conf, FILE *stream, vector keywords,
goto out;
}
if (keyword->handler) {
- t = (*keyword->handler) (conf, strvec);
+ t = keyword->handler(conf, strvec);
r += t;
if (t)
condlog(1, "multipath.conf +%d, parsing failed: %s",
@@ -43,10 +43,11 @@ struct strbuf;
/* keyword definition */
typedef int print_fn(struct config *, struct strbuf *, const void *);
+typedef int handler_fn(struct config *, vector);
struct keyword {
char *string;
- int (*handler) (struct config *, vector);
+ handler_fn *handler;
print_fn *print;
vector sub;
int unique;
@@ -62,18 +63,14 @@ struct keyword {
for (i = 0; i < (k)->sub->allocated && ((p) = (k)->sub->slot[i]); i++)
/* Prototypes */
-extern int keyword_alloc(vector keywords, char *string,
- int (*handler) (struct config *, vector),
- print_fn *print,
- int unique);
+extern int keyword_alloc(vector keywords, char *string, handler_fn *handler,
+ print_fn *print, int unique);
#define install_keyword_root(str, h) keyword_alloc(keywords, str, h, NULL, 1)
extern void install_sublevel(void);
extern void install_sublevel_end(void);
-extern int _install_keyword(vector keywords, char *string,
- int (*handler) (struct config *, vector),
- print_fn *print,
- int unique);
+extern int _install_keyword(vector keywords, char *string, handler_fn *handler,
+ print_fn *print, int unique);
#define install_keyword(str, vec, pri) _install_keyword(keywords, str, vec, pri, 1)
#define install_keyword_multi(str, vec, pri) _install_keyword(keywords, str, vec, pri, 0)
extern void dump_keywords(vector keydump, int level);