aboutsummaryrefslogtreecommitdiff
path: root/read_config_file.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-01-06 18:55:18 +0100
committerPetr Machata <pmachata@redhat.com>2012-08-29 19:02:06 +0200
commit2fb2b8d877ae562374a89ad777ec24534522840e (patch)
treea70331ed770e366ffd143841746303eeb32a3761 /read_config_file.c
parentf83053d927d0e7a488b1077136eea7611a022553 (diff)
downloadltrace-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.c15
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