aboutsummaryrefslogtreecommitdiff
path: root/read_config_file.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-01-09 04:25:31 +0100
committerPetr Machata <pmachata@redhat.com>2012-08-29 19:02:07 +0200
commitce034981e2880eecb8a196c78182dfb4ae67850f (patch)
tree77878ccac43b87b54f5ec5b20cc1031dffc75219 /read_config_file.c
parent31af32cfcd61671cbb5e567870103766b3231521 (diff)
downloadltrace-ce034981e2880eecb8a196c78182dfb4ae67850f.tar.gz
Replace ARGTYPE_OCTAL with lens, add also hex lens
Diffstat (limited to 'read_config_file.c')
-rw-r--r--read_config_file.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/read_config_file.c b/read_config_file.c
index 262aa17..2b82272 100644
--- a/read_config_file.c
+++ b/read_config_file.c
@@ -72,7 +72,6 @@ parse_arg_type(char **name, enum arg_type *ret)
KEYWORD("uint", ARGTYPE_UINT);
KEYWORD("long", ARGTYPE_LONG);
KEYWORD("ulong", ARGTYPE_ULONG);
- KEYWORD("octal", ARGTYPE_OCTAL);
KEYWORD("char", ARGTYPE_CHAR);
KEYWORD("short", ARGTYPE_SHORT);
KEYWORD("ushort", ARGTYPE_USHORT);
@@ -718,7 +717,6 @@ parse_nonpointer_type(char **str, struct param **extra_param, size_t param_num,
case ARGTYPE_UINT:
case ARGTYPE_LONG:
case ARGTYPE_ULONG:
- case ARGTYPE_OCTAL:
case ARGTYPE_CHAR:
case ARGTYPE_SHORT:
case ARGTYPE_USHORT:
@@ -772,6 +770,9 @@ static struct named_lens {
const char *name;
struct lens *lens;
} lenses[] = {
+ { "hide", &blind_lens },
+ { "octal", &octal_lens },
+ { "hex", &hex_lens },
};
static struct lens *
@@ -831,7 +832,13 @@ parse_lens(char **str, struct param **extra_param, size_t param_num, int *ownp)
if (lens != NULL) {
eat_spaces(str);
- if (parse_char(str, '(') < 0) {
+ /* Octal lens gets special treatment, because of
+ * backward compatibility. */
+ if (lens == &octal_lens && **str != '(') {
+ has_args = 0;
+ info = type_get_simple(ARGTYPE_INT);
+ *ownp = 0;
+ } else if (parse_char(str, '(') < 0) {
report_error(filename, line_no,
"expected type argument after the lens");
return NULL;