diff options
Diffstat (limited to 'parse-filter.c')
-rw-r--r-- | parse-filter.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/parse-filter.c b/parse-filter.c index 8bef91a..fce0694 100644 --- a/parse-filter.c +++ b/parse-filter.c | |||
@@ -359,7 +359,7 @@ create_arg_item(struct event_format *event, | |||
359 | if (strcmp(token, COMM) != 0) { | 359 | if (strcmp(token, COMM) != 0) { |
360 | /* not a field, Make it false */ | 360 | /* not a field, Make it false */ |
361 | arg->type = FILTER_ARG_BOOLEAN; | 361 | arg->type = FILTER_ARG_BOOLEAN; |
362 | arg->bool.value = FILTER_FALSE; | 362 | arg->boolean.value = FILTER_FALSE; |
363 | break; | 363 | break; |
364 | } | 364 | } |
365 | /* If token is 'COMM' then it is special */ | 365 | /* If token is 'COMM' then it is special */ |
@@ -487,7 +487,7 @@ static int add_right(struct filter_arg *op, struct filter_arg *arg, | |||
487 | free_arg(left); | 487 | free_arg(left); |
488 | free_arg(arg); | 488 | free_arg(arg); |
489 | op->type = FILTER_ARG_BOOLEAN; | 489 | op->type = FILTER_ARG_BOOLEAN; |
490 | op->bool.value = FILTER_FALSE; | 490 | op->boolean.value = FILTER_FALSE; |
491 | break; | 491 | break; |
492 | } | 492 | } |
493 | 493 | ||
@@ -772,7 +772,7 @@ enum filter_vals test_arg(struct filter_arg *parent, struct filter_arg *arg) | |||
772 | 772 | ||
773 | /* bad case */ | 773 | /* bad case */ |
774 | case FILTER_ARG_BOOLEAN: | 774 | case FILTER_ARG_BOOLEAN: |
775 | return FILTER_VAL_FALSE + arg->bool.value; | 775 | return FILTER_VAL_FALSE + arg->boolean.value; |
776 | 776 | ||
777 | /* good cases: */ | 777 | /* good cases: */ |
778 | case FILTER_ARG_STR: | 778 | case FILTER_ARG_STR: |
@@ -871,7 +871,7 @@ static struct filter_arg *collapse_tree(struct filter_arg *arg) | |||
871 | free_arg(arg); | 871 | free_arg(arg); |
872 | arg = allocate_arg(); | 872 | arg = allocate_arg(); |
873 | arg->type = FILTER_ARG_BOOLEAN; | 873 | arg->type = FILTER_ARG_BOOLEAN; |
874 | arg->bool.value = ret == FILTER_VAL_TRUE; | 874 | arg->boolean.value = ret == FILTER_VAL_TRUE; |
875 | } | 875 | } |
876 | 876 | ||
877 | return arg; | 877 | return arg; |
@@ -1116,7 +1116,7 @@ process_event(struct event_format *event, const char *filter_str, | |||
1116 | if (!*parg) { | 1116 | if (!*parg) { |
1117 | *parg = allocate_arg(); | 1117 | *parg = allocate_arg(); |
1118 | (*parg)->type = FILTER_ARG_BOOLEAN; | 1118 | (*parg)->type = FILTER_ARG_BOOLEAN; |
1119 | (*parg)->bool.value = FILTER_FALSE; | 1119 | (*parg)->boolean.value = FILTER_FALSE; |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | return 0; | 1122 | return 0; |
@@ -1139,7 +1139,7 @@ static int filter_event(struct event_filter *filter, | |||
1139 | /* just add a TRUE arg */ | 1139 | /* just add a TRUE arg */ |
1140 | arg = allocate_arg(); | 1140 | arg = allocate_arg(); |
1141 | arg->type = FILTER_ARG_BOOLEAN; | 1141 | arg->type = FILTER_ARG_BOOLEAN; |
1142 | arg->bool.value = FILTER_TRUE; | 1142 | arg->boolean.value = FILTER_TRUE; |
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | filter_type = add_filter_type(filter, event->id); | 1145 | filter_type = add_filter_type(filter, event->id); |
@@ -1369,9 +1369,9 @@ static int copy_filter_type(struct event_filter *filter, | |||
1369 | arg = allocate_arg(); | 1369 | arg = allocate_arg(); |
1370 | arg->type = FILTER_ARG_BOOLEAN; | 1370 | arg->type = FILTER_ARG_BOOLEAN; |
1371 | if (strcmp(str, "TRUE") == 0) | 1371 | if (strcmp(str, "TRUE") == 0) |
1372 | arg->bool.value = 1; | 1372 | arg->boolean.value = 1; |
1373 | else | 1373 | else |
1374 | arg->bool.value = 0; | 1374 | arg->boolean.value = 0; |
1375 | 1375 | ||
1376 | filter_type = add_filter_type(filter, event->id); | 1376 | filter_type = add_filter_type(filter, event->id); |
1377 | filter_type->filter = arg; | 1377 | filter_type->filter = arg; |
@@ -1442,8 +1442,8 @@ int pevent_update_trivial(struct event_filter *dest, struct event_filter *source | |||
1442 | arg = filter_type->filter; | 1442 | arg = filter_type->filter; |
1443 | if (arg->type != FILTER_ARG_BOOLEAN) | 1443 | if (arg->type != FILTER_ARG_BOOLEAN) |
1444 | continue; | 1444 | continue; |
1445 | if ((arg->bool.value && type == FILTER_TRIVIAL_FALSE) || | 1445 | if ((arg->boolean.value && type == FILTER_TRIVIAL_FALSE) || |
1446 | (!arg->bool.value && type == FILTER_TRIVIAL_TRUE)) | 1446 | (!arg->boolean.value && type == FILTER_TRIVIAL_TRUE)) |
1447 | continue; | 1447 | continue; |
1448 | 1448 | ||
1449 | event = filter_type->event; | 1449 | event = filter_type->event; |
@@ -1497,10 +1497,10 @@ void pevent_filter_clear_trivial(struct event_filter *filter, | |||
1497 | continue; | 1497 | continue; |
1498 | switch (type) { | 1498 | switch (type) { |
1499 | case FILTER_TRIVIAL_FALSE: | 1499 | case FILTER_TRIVIAL_FALSE: |
1500 | if (filter_type->filter->bool.value) | 1500 | if (filter_type->filter->boolean.value) |
1501 | continue; | 1501 | continue; |
1502 | case FILTER_TRIVIAL_TRUE: | 1502 | case FILTER_TRIVIAL_TRUE: |
1503 | if (!filter_type->filter->bool.value) | 1503 | if (!filter_type->filter->boolean.value) |
1504 | continue; | 1504 | continue; |
1505 | default: | 1505 | default: |
1506 | break; | 1506 | break; |
@@ -1551,10 +1551,10 @@ int pevent_filter_event_has_trivial(struct event_filter *filter, | |||
1551 | 1551 | ||
1552 | switch (type) { | 1552 | switch (type) { |
1553 | case FILTER_TRIVIAL_FALSE: | 1553 | case FILTER_TRIVIAL_FALSE: |
1554 | return !filter_type->filter->bool.value; | 1554 | return !filter_type->filter->boolean.value; |
1555 | 1555 | ||
1556 | case FILTER_TRIVIAL_TRUE: | 1556 | case FILTER_TRIVIAL_TRUE: |
1557 | return filter_type->filter->bool.value; | 1557 | return filter_type->filter->boolean.value; |
1558 | default: | 1558 | default: |
1559 | return 1; | 1559 | return 1; |
1560 | } | 1560 | } |
@@ -1783,7 +1783,7 @@ static int test_filter(struct event_format *event, | |||
1783 | switch (arg->type) { | 1783 | switch (arg->type) { |
1784 | case FILTER_ARG_BOOLEAN: | 1784 | case FILTER_ARG_BOOLEAN: |
1785 | /* easy case */ | 1785 | /* easy case */ |
1786 | return arg->bool.value; | 1786 | return arg->boolean.value; |
1787 | 1787 | ||
1788 | case FILTER_ARG_OP: | 1788 | case FILTER_ARG_OP: |
1789 | return test_op(event, arg, record); | 1789 | return test_op(event, arg, record); |
@@ -2147,7 +2147,7 @@ static char *arg_to_str(struct event_filter *filter, struct filter_arg *arg) | |||
2147 | switch (arg->type) { | 2147 | switch (arg->type) { |
2148 | case FILTER_ARG_BOOLEAN: | 2148 | case FILTER_ARG_BOOLEAN: |
2149 | str = malloc_or_die(6); | 2149 | str = malloc_or_die(6); |
2150 | if (arg->bool.value) | 2150 | if (arg->boolean.value) |
2151 | strcpy(str, "TRUE"); | 2151 | strcpy(str, "TRUE"); |
2152 | else | 2152 | else |
2153 | strcpy(str, "FALSE"); | 2153 | strcpy(str, "FALSE"); |