FIELD_IS_STRING = 8,
FIELD_IS_DYNAMIC = 16,
FIELD_IS_LONG = 32,
+ FIELD_IS_FLAG = 64,
+ FIELD_IS_SYMBOLIC = 128,
};
struct format_field {
struct event_format *last_event;
};
-/* Can be overridden */
-void die(const char *fmt, ...);
-void *malloc_or_die(unsigned int size);
-void warning(const char *fmt, ...);
-void pr_stat(const char *fmt, ...);
-void vpr_stat(const char *fmt, va_list ap);
-
-/* Always available */
-void __die(const char *fmt, ...);
-void __warning(const char *fmt, ...);
-void __pr_stat(const char *fmt, ...);
-
-void __vdie(const char *fmt, ...);
-void __vwarning(const char *fmt, ...);
-void __vpr_stat(const char *fmt, ...);
-
static inline unsigned short
__data2host2(struct pevent *pevent, unsigned short data)
{
struct filter_arg {
enum filter_arg_type type;
union {
- struct filter_arg_boolean bool;
+ struct filter_arg_boolean boolean;
struct filter_arg_field field;
struct filter_arg_value value;
struct filter_arg_op op;
#include <ctype.h>
+/* Can be overridden */
+void die(const char *fmt, ...);
+void *malloc_or_die(unsigned int size);
+void warning(const char *fmt, ...);
+void pr_stat(const char *fmt, ...);
+void vpr_stat(const char *fmt, va_list ap);
+
+/* Always available */
+void __die(const char *fmt, ...);
+void __warning(const char *fmt, ...);
+void __pr_stat(const char *fmt, ...);
+
+void __vdie(const char *fmt, ...);
+void __vwarning(const char *fmt, ...);
+void __vpr_stat(const char *fmt, ...);
+
static inline char *strim(char *string)
{
char *ret;
if (strcmp(token, COMM) != 0) {
/* not a field, Make it false */
arg->type = FILTER_ARG_BOOLEAN;
- arg->bool.value = FILTER_FALSE;
+ arg->boolean.value = FILTER_FALSE;
break;
}
/* If token is 'COMM' then it is special */
free_arg(left);
free_arg(arg);
op->type = FILTER_ARG_BOOLEAN;
- op->bool.value = FILTER_FALSE;
+ op->boolean.value = FILTER_FALSE;
break;
}
/* bad case */
case FILTER_ARG_BOOLEAN:
- return FILTER_VAL_FALSE + arg->bool.value;
+ return FILTER_VAL_FALSE + arg->boolean.value;
/* good cases: */
case FILTER_ARG_STR:
free_arg(arg);
arg = allocate_arg();
arg->type = FILTER_ARG_BOOLEAN;
- arg->bool.value = ret == FILTER_VAL_TRUE;
+ arg->boolean.value = ret == FILTER_VAL_TRUE;
}
return arg;
if (!*parg) {
*parg = allocate_arg();
(*parg)->type = FILTER_ARG_BOOLEAN;
- (*parg)->bool.value = FILTER_FALSE;
+ (*parg)->boolean.value = FILTER_FALSE;
}
return 0;
/* just add a TRUE arg */
arg = allocate_arg();
arg->type = FILTER_ARG_BOOLEAN;
- arg->bool.value = FILTER_TRUE;
+ arg->boolean.value = FILTER_TRUE;
}
filter_type = add_filter_type(filter, event->id);
arg = allocate_arg();
arg->type = FILTER_ARG_BOOLEAN;
if (strcmp(str, "TRUE") == 0)
- arg->bool.value = 1;
+ arg->boolean.value = 1;
else
- arg->bool.value = 0;
+ arg->boolean.value = 0;
filter_type = add_filter_type(filter, event->id);
filter_type->filter = arg;
arg = filter_type->filter;
if (arg->type != FILTER_ARG_BOOLEAN)
continue;
- if ((arg->bool.value && type == FILTER_TRIVIAL_FALSE) ||
- (!arg->bool.value && type == FILTER_TRIVIAL_TRUE))
+ if ((arg->boolean.value && type == FILTER_TRIVIAL_FALSE) ||
+ (!arg->boolean.value && type == FILTER_TRIVIAL_TRUE))
continue;
event = filter_type->event;
continue;
switch (type) {
case FILTER_TRIVIAL_FALSE:
- if (filter_type->filter->bool.value)
+ if (filter_type->filter->boolean.value)
continue;
case FILTER_TRIVIAL_TRUE:
- if (!filter_type->filter->bool.value)
+ if (!filter_type->filter->boolean.value)
continue;
default:
break;
switch (type) {
case FILTER_TRIVIAL_FALSE:
- return !filter_type->filter->bool.value;
+ return !filter_type->filter->boolean.value;
case FILTER_TRIVIAL_TRUE:
- return filter_type->filter->bool.value;
+ return filter_type->filter->boolean.value;
default:
return 1;
}
switch (arg->type) {
case FILTER_ARG_BOOLEAN:
/* easy case */
- return arg->bool.value;
+ return arg->boolean.value;
case FILTER_ARG_OP:
return test_op(event, arg, record);
switch (arg->type) {
case FILTER_ARG_BOOLEAN:
str = malloc_or_die(6);
- if (arg->bool.value)
+ if (arg->boolean.value)
strcpy(str, "TRUE");
else
strcpy(str, "FALSE");