MEDIUM: pattern: use the standard arg parser
We don't need the pattern-specific args parsers anymore, make use of the
common parser instead. We still need to improve this by adding a validation
function to report abnormal argument values or combinations. We don't report
precise parsing errors yet but this was not previously done either.
diff --git a/include/types/pattern.h b/include/types/pattern.h
index 1014856..c371886 100644
--- a/include/types/pattern.h
+++ b/include/types/pattern.h
@@ -64,8 +64,7 @@
const char *kw; /* configuration keyword */
int (*process)(const struct arg *arg_p,
union pattern_data *data); /* process function */
- int (*parse_args)(const char *arg_str,
- struct arg **arg_p); /* argument parser. May be NULL. */
+ unsigned int arg_mask; /* arguments (ARG*()) */
unsigned int in_type; /* input needed pattern type */
unsigned int out_type; /* output pattern type */
};
@@ -85,8 +84,7 @@
void *l7,
int dir, const struct arg *arg_p,
union pattern_data *data); /* fetch processing function */
- int (*parse_args)(const char *arg_str,
- struct arg **arg_p); /* argument parser. Can be NULL. */
+ unsigned int arg_mask; /* arguments (ARG*()) */
unsigned long out_type; /* output pattern type */
int dir; /* usable directions */
};