diff options
author | Petr Machata <pmachata@redhat.com> | 2012-01-06 18:55:18 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-08-29 19:02:06 +0200 |
commit | 2fb2b8d877ae562374a89ad777ec24534522840e (patch) | |
tree | a70331ed770e366ffd143841746303eeb32a3761 /read_config_file.c | |
parent | f83053d927d0e7a488b1077136eea7611a022553 (diff) | |
download | ltrace-2fb2b8d877ae562374a89ad777ec24534522840e.tar.gz |
Drop ARGTYPE_ADDR, ARGTYPE_FILE, introduce same as implicit typedefs
Diffstat (limited to 'read_config_file.c')
-rw-r--r-- | read_config_file.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/read_config_file.c b/read_config_file.c index 222bb20..140b0f8 100644 --- a/read_config_file.c +++ b/read_config_file.c @@ -63,8 +63,6 @@ static struct list_of_pt_t { "ushort", ARGTYPE_USHORT}, { "float", ARGTYPE_FLOAT}, { "double", ARGTYPE_DOUBLE}, { - "addr", ARGTYPE_ADDR}, { - "file", ARGTYPE_FILE}, { "format", ARGTYPE_FORMAT}, { "string", ARGTYPE_STRING}, { "array", ARGTYPE_ARRAY}, { @@ -88,8 +86,6 @@ static struct arg_type_info arg_type_prototypes[] = { { ARGTYPE_USHORT }, { ARGTYPE_FLOAT }, { ARGTYPE_DOUBLE }, - { ARGTYPE_ADDR }, - { ARGTYPE_FILE }, { ARGTYPE_FORMAT }, { ARGTYPE_STRING }, { ARGTYPE_STRING_N }, @@ -774,6 +770,17 @@ process_line(char *buf) { void init_global_config(void) { + struct arg_type_info *info = malloc(2 * sizeof(*info)); + if (info == NULL) + error(1, errno, "malloc in init_global_config"); + + memset(info, 0, 2 * sizeof(*info)); + info[0].type = ARGTYPE_POINTER; + info[0].u.ptr_info.info = &info[1]; + info[1].type = ARGTYPE_VOID; + + insert_typedef(strdup("addr"), info, 0); + insert_typedef(strdup("file"), info, 1); } void |