aboutsummaryrefslogtreecommitdiff
path: root/read_config_file.c
diff options
context:
space:
mode:
authorSteve Fink <sphink@gmail.com>2006-08-07 04:50:42 +0200
committerIan Wienand <ianw@debian.org>2006-08-07 04:50:42 +0200
commit7bafff09cc66e23519512a54e2d1ebd3664a1a70 (patch)
tree6c87264dc143e999528de2caa54f1ad35b9a7e50 /read_config_file.c
parent6b17583208a9297a2e2054422399ec3265e38f8b (diff)
downloadltrace-7bafff09cc66e23519512a54e2d1ebd3664a1a70.tar.gz
pass values instead of argument numbers to fetch
Diffstat (limited to 'read_config_file.c')
-rw-r--r--read_config_file.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/read_config_file.c b/read_config_file.c
index 3927af2..15c3f39 100644
--- a/read_config_file.c
+++ b/read_config_file.c
@@ -47,6 +47,7 @@ static arg_type_info arg_type_singletons[] = {
{ ARGTYPE_STRING },
{ ARGTYPE_STRING_N },
{ ARGTYPE_IGNORE },
+ { ARGTYPE_POINTER },
{ ARGTYPE_UNKNOWN }
};
@@ -64,7 +65,7 @@ static arg_type_info *str2type(char **str)
while (tmp->name) {
if (!strncmp(*str, tmp->name, strlen(tmp->name))
- && index(" ,()#;012345[", *(*str + strlen(tmp->name)))) {
+ && index(" ,()#*;012345[", *(*str + strlen(tmp->name)))) {
*str += strlen(tmp->name);
return lookup_singleton(tmp->pt);
}
@@ -169,7 +170,7 @@ static int parse_argnum(char **str)
return n * multiplier;
}
-static arg_type_info *parse_type(char **str)
+static arg_type_info *parse_nonpointer_type(char **str)
{
arg_type_info *simple;
arg_type_info *info;
@@ -220,6 +221,19 @@ static arg_type_info *parse_type(char **str)
}
}
+static arg_type_info *parse_type(char **str)
+{
+ arg_type_info *info = parse_nonpointer_type(str);
+ while (**str == '*') {
+ arg_type_info *outer = malloc(sizeof(*info));
+ outer->type = ARGTYPE_POINTER;
+ outer->u.ptr_info.info = info;
+ (*str)++;
+ info = outer;
+ }
+ return info;
+}
+
static struct function *process_line(char *buf)
{
struct function fun;