Lines Matching refs:token

1173 void pevent_free_token(char *token)  in pevent_free_token()  argument
1175 free_token(token); in pevent_free_token()
1206 static int test_type_token(enum event_type type, const char *token, in test_type_token() argument
1215 if (strcmp(token, expect_tok) != 0) { in test_type_token()
1217 expect_tok, token); in test_type_token()
1243 char *token; in __read_expected() local
1247 type = read_token(&token); in __read_expected()
1249 type = read_token_item(&token); in __read_expected()
1251 ret = test_type_token(type, token, expect, str); in __read_expected()
1253 free_token(token); in __read_expected()
1270 char *token; in event_read_name() local
1278 if (read_expect_type(EVENT_ITEM, &token) < 0) in event_read_name()
1281 return token; in event_read_name()
1284 free_token(token); in event_read_name()
1290 char *token; in event_read_id() local
1299 if (read_expect_type(EVENT_ITEM, &token) < 0) in event_read_id()
1302 id = strtoul(token, NULL, 0); in event_read_id()
1303 free_token(token); in event_read_id()
1307 free_token(token); in event_read_id()
1370 char *token; in event_read_fields() local
1377 type = read_token(&token); in event_read_fields()
1379 free_token(token); in event_read_fields()
1385 if (test_type_token(type, token, EVENT_ITEM, "field")) in event_read_fields()
1387 free_token(token); in event_read_fields()
1389 type = read_token(&token); in event_read_fields()
1395 type == EVENT_ITEM && strcmp(token, "special") == 0) { in event_read_fields()
1396 free_token(token); in event_read_fields()
1397 type = read_token(&token); in event_read_fields()
1400 if (test_type_token(type, token, EVENT_OP, ":") < 0) in event_read_fields()
1403 free_token(token); in event_read_fields()
1404 if (read_expect_type(EVENT_ITEM, &token) < 0) in event_read_fields()
1407 last_token = token; in event_read_fields()
1417 type = read_token(&token); in event_read_fields()
1419 (type == EVENT_OP && strcmp(token, "*") == 0) || in event_read_fields()
1425 type == EVENT_OP && strcmp(token, ".") == 0)) { in event_read_fields()
1427 if (strcmp(token, "*") == 0) in event_read_fields()
1445 last_token = token; in event_read_fields()
1461 if (strcmp(token, "[") == 0) { in event_read_fields()
1463 char *brackets = token; in event_read_fields()
1469 type = read_token(&token); in event_read_fields()
1472 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1476 while (strcmp(token, "]") != 0) { in event_read_fields()
1486 strlen(token) + len); in event_read_fields()
1494 strcat(brackets, token); in event_read_fields()
1496 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1497 free_token(token); in event_read_fields()
1498 type = read_token(&token); in event_read_fields()
1505 free_token(token); in event_read_fields()
1517 type = read_token(&token); in event_read_fields()
1538 field->name = field->alias = token; in event_read_fields()
1539 type = read_token(&token); in event_read_fields()
1562 if (test_type_token(type, token, EVENT_OP, ";")) in event_read_fields()
1564 free_token(token); in event_read_fields()
1572 if (read_expect_type(EVENT_ITEM, &token)) in event_read_fields()
1574 field->offset = strtoul(token, NULL, 0); in event_read_fields()
1575 free_token(token); in event_read_fields()
1586 if (read_expect_type(EVENT_ITEM, &token)) in event_read_fields()
1588 field->size = strtoul(token, NULL, 0); in event_read_fields()
1589 free_token(token); in event_read_fields()
1594 type = read_token(&token); in event_read_fields()
1597 if (test_type_token(type, token, EVENT_ITEM, "signed")) in event_read_fields()
1600 free_token(token); in event_read_fields()
1605 if (read_expect_type(EVENT_ITEM, &token)) in event_read_fields()
1608 if (strtoul(token, NULL, 0)) in event_read_fields()
1611 free_token(token); in event_read_fields()
1615 if (read_expect_type(EVENT_NEWLINE, &token)) in event_read_fields()
1619 free_token(token); in event_read_fields()
1643 free_token(token); in event_read_fields()
1655 char *token; in event_read_format() local
1664 if (read_expect_type(EVENT_NEWLINE, &token)) in event_read_format()
1666 free_token(token); in event_read_format()
1681 free_token(token); in event_read_format()
1693 char *token; in process_arg() local
1695 type = read_token(&token); in process_arg()
1696 *tok = token; in process_arg()
1727 char *token = NULL; in process_cond() local
1746 type = process_arg(event, left, &token); in process_cond()
1753 if (type == EVENT_OP && strcmp(token, ":") != 0) { in process_cond()
1754 type = process_op(event, left, &token); in process_cond()
1758 if (test_type_token(type, token, EVENT_OP, ":")) in process_cond()
1761 arg->op.op = token; in process_cond()
1763 type = process_arg(event, right, &token); in process_cond()
1767 *tok = token; in process_cond()
1773 free_token(token); in process_cond()
1783 char *token = NULL; in process_array() local
1794 type = process_arg(event, arg, &token); in process_array()
1795 if (test_type_token(type, token, EVENT_OP, "]")) in process_array()
1800 free_token(token); in process_array()
1801 type = read_token_item(&token); in process_array()
1802 *tok = token; in process_array()
1807 free_token(token); in process_array()
1885 char *token; in process_op() local
1888 token = *tok; in process_op()
1892 if (token[1]) { in process_op()
1893 do_warning_event(event, "bad op token %s", token); in process_op()
1896 switch (token[0]) { in process_op()
1903 do_warning_event(event, "bad op token %s", token); in process_op()
1926 } else if (strcmp(token, "?") == 0) { in process_op()
1936 arg->op.op = token; in process_op()
1943 } else if (strcmp(token, ">>") == 0 || in process_op()
1944 strcmp(token, "<<") == 0 || in process_op()
1945 strcmp(token, "&") == 0 || in process_op()
1946 strcmp(token, "|") == 0 || in process_op()
1947 strcmp(token, "&&") == 0 || in process_op()
1948 strcmp(token, "||") == 0 || in process_op()
1949 strcmp(token, "-") == 0 || in process_op()
1950 strcmp(token, "+") == 0 || in process_op()
1951 strcmp(token, "*") == 0 || in process_op()
1952 strcmp(token, "^") == 0 || in process_op()
1953 strcmp(token, "/") == 0 || in process_op()
1954 strcmp(token, "<") == 0 || in process_op()
1955 strcmp(token, ">") == 0 || in process_op()
1956 strcmp(token, "<=") == 0 || in process_op()
1957 strcmp(token, ">=") == 0 || in process_op()
1958 strcmp(token, "==") == 0 || in process_op()
1959 strcmp(token, "!=") == 0) { in process_op()
1969 arg->op.op = token; in process_op()
1980 type = read_token_item(&token); in process_op()
1981 *tok = token; in process_op()
1985 type == EVENT_DELIM && (strcmp(token, ")") == 0)) { in process_op()
2014 token = NULL; in process_op()
2034 } else if (strcmp(token, "[") == 0) { in process_op()
2043 arg->op.op = token; in process_op()
2052 do_warning_event(event, "unknown op '%s'", token); in process_op()
2075 free_token(token); in process_op()
2086 char *token; in process_entry() local
2091 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_entry()
2093 field = token; in process_entry()
2108 type = read_token(&token); in process_entry()
2109 *tok = token; in process_entry()
2114 free_token(token); in process_entry()
2125 char *token; in alloc_and_process_delim() local
2135 type = process_arg(event, field, &token); in alloc_and_process_delim()
2137 if (test_type_token(type, token, EVENT_DELIM, next_token)) { in alloc_and_process_delim()
2147 free_token(token); in alloc_and_process_delim()
2454 char *token = *tok; in process_fields() local
2458 free_token(token); in process_fields()
2459 type = read_token_item(&token); in process_fields()
2460 if (test_type_token(type, token, EVENT_OP, "{")) in process_fields()
2467 free_token(token); in process_fields()
2468 type = process_arg(event, arg, &token); in process_fields()
2471 type = process_op(event, arg, &token); in process_fields()
2476 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_fields()
2495 free_token(token); in process_fields()
2496 type = process_arg(event, arg, &token); in process_fields()
2497 if (test_type_token(type, token, EVENT_OP, "}")) in process_fields()
2512 free_token(token); in process_fields()
2513 type = read_token_item(&token); in process_fields()
2514 } while (type == EVENT_DELIM && strcmp(token, ",") == 0); in process_fields()
2516 *tok = token; in process_fields()
2523 free_token(token); in process_fields()
2534 char *token = NULL; in process_flags() local
2545 type = process_field_arg(event, field, &token); in process_flags()
2549 type = process_op(event, field, &token); in process_flags()
2551 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_flags()
2553 free_token(token); in process_flags()
2557 type = read_token_item(&token); in process_flags()
2559 arg->flags.delim = token; in process_flags()
2560 type = read_token_item(&token); in process_flags()
2563 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_flags()
2566 type = process_fields(event, &arg->flags.flags, &token); in process_flags()
2567 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_flags()
2570 free_token(token); in process_flags()
2577 free_token(token); in process_flags()
2587 char *token = NULL; in process_symbols() local
2598 type = process_field_arg(event, field, &token); in process_symbols()
2600 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_symbols()
2605 type = process_fields(event, &arg->symbol.symbols, &token); in process_symbols()
2606 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_symbols()
2609 free_token(token); in process_symbols()
2616 free_token(token); in process_symbols()
2673 char *token; in process_dynamic_array() local
2682 type = read_token(&token); in process_dynamic_array()
2683 *tok = token; in process_dynamic_array()
2689 field = pevent_find_field(event, token); in process_dynamic_array()
2699 free_token(token); in process_dynamic_array()
2700 type = read_token_item(&token); in process_dynamic_array()
2701 *tok = token; in process_dynamic_array()
2702 if (type != EVENT_OP || strcmp(token, "[") != 0) in process_dynamic_array()
2705 free_token(token); in process_dynamic_array()
2713 type = process_arg(event, arg, &token); in process_dynamic_array()
2717 if (!test_type_token(type, token, EVENT_OP, "]")) in process_dynamic_array()
2720 free_token(token); in process_dynamic_array()
2727 free_token(token); in process_dynamic_array()
2738 char *token; in process_dynamic_array_len() local
2740 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_dynamic_array_len()
2746 field = pevent_find_field(event, token); in process_dynamic_array_len()
2756 type = read_token(&token); in process_dynamic_array_len()
2757 *tok = token; in process_dynamic_array_len()
2762 free_token(token); in process_dynamic_array_len()
2773 char *token; in process_paren() local
2775 type = process_arg(event, arg, &token); in process_paren()
2781 type = process_op(event, arg, &token); in process_paren()
2786 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_paren()
2789 free_token(token); in process_paren()
2790 type = read_token_item(&token); in process_paren()
2797 (type == EVENT_DELIM && strcmp(token, "(") == 0)) { in process_paren()
2817 type = process_arg_token(event, item_arg, &token, type); in process_paren()
2821 *tok = token; in process_paren()
2825 free_token(token); in process_paren()
2836 char *token; in process_str() local
2838 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_str()
2842 arg->string.string = token; in process_str()
2848 type = read_token(&token); in process_str()
2849 *tok = token; in process_str()
2854 free_token(token); in process_str()
2865 char *token; in process_bitmask() local
2867 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_bitmask()
2871 arg->bitmask.bitmask = token; in process_bitmask()
2877 type = read_token(&token); in process_bitmask()
2878 *tok = token; in process_bitmask()
2883 free_token(token); in process_bitmask()
2928 char *token; in process_func_handler() local
2945 type = process_arg(event, farg, &token); in process_func_handler()
2947 if (type != EVENT_DELIM || strcmp(token, ",") != 0) { in process_func_handler()
2955 if (type != EVENT_DELIM || strcmp(token, ")") != 0) { in process_func_handler()
2965 free_token(token); in process_func_handler()
2968 type = read_token(&token); in process_func_handler()
2969 *tok = token; in process_func_handler()
2975 free_token(token); in process_func_handler()
2981 char *token, char **tok) in process_function() argument
2985 if (strcmp(token, "__print_flags") == 0) { in process_function()
2986 free_token(token); in process_function()
2990 if (strcmp(token, "__print_symbolic") == 0) { in process_function()
2991 free_token(token); in process_function()
2995 if (strcmp(token, "__print_hex") == 0) { in process_function()
2996 free_token(token); in process_function()
2999 if (strcmp(token, "__print_array") == 0) { in process_function()
3000 free_token(token); in process_function()
3003 if (strcmp(token, "__get_str") == 0) { in process_function()
3004 free_token(token); in process_function()
3007 if (strcmp(token, "__get_bitmask") == 0) { in process_function()
3008 free_token(token); in process_function()
3011 if (strcmp(token, "__get_dynamic_array") == 0) { in process_function()
3012 free_token(token); in process_function()
3015 if (strcmp(token, "__get_dynamic_array_len") == 0) { in process_function()
3016 free_token(token); in process_function()
3020 func = find_func_handler(event->pevent, token); in process_function()
3022 free_token(token); in process_function()
3026 do_warning_event(event, "function %s not defined", token); in process_function()
3027 free_token(token); in process_function()
3035 char *token; in process_arg_token() local
3038 token = *tok; in process_arg_token()
3042 if (strcmp(token, "REC") == 0) { in process_arg_token()
3043 free_token(token); in process_arg_token()
3044 type = process_entry(event, arg, &token); in process_arg_token()
3047 atom = token; in process_arg_token()
3049 type = read_token_item(&token); in process_arg_token()
3055 if (type == EVENT_DELIM && strcmp(token, "(") == 0) { in process_arg_token()
3056 free_token(token); in process_arg_token()
3057 token = NULL; in process_arg_token()
3059 type = process_function(event, arg, atom, &token); in process_arg_token()
3066 strlen(atom) + strlen(token) + 2); in process_arg_token()
3070 free_token(token); in process_arg_token()
3075 strcat(atom, token); in process_arg_token()
3076 free_token(token); in process_arg_token()
3077 type = read_token_item(&token); in process_arg_token()
3087 arg->atom.atom = token; in process_arg_token()
3088 type = read_token_item(&token); in process_arg_token()
3091 if (strcmp(token, "(") == 0) { in process_arg_token()
3092 free_token(token); in process_arg_token()
3093 type = process_paren(event, arg, &token); in process_arg_token()
3099 arg->op.op = token; in process_arg_token()
3101 type = process_op(event, arg, &token); in process_arg_token()
3115 *tok = token; in process_arg_token()
3124 char *token; in event_read_print_args() local
3129 type = read_token_item(&token); in event_read_print_args()
3140 type = process_arg(event, arg, &token); in event_read_print_args()
3143 free_token(token); in event_read_print_args()
3152 type = process_op(event, arg, &token); in event_read_print_args()
3153 free_token(token); in event_read_print_args()
3163 if (type == EVENT_DELIM && strcmp(token, ",") == 0) { in event_read_print_args()
3164 free_token(token); in event_read_print_args()
3173 free_token(token); in event_read_print_args()
3181 char *token; in event_read_print() local
3193 if (read_expect_type(EVENT_DQUOTE, &token) < 0) in event_read_print()
3197 event->print_fmt.format = token; in event_read_print()
3201 type = read_token_item(&token); in event_read_print()
3210 if (asprintf(&cat, "%s%s", event->print_fmt.format, token) < 0) in event_read_print()
3212 free_token(token); in event_read_print()
3215 token = cat; in event_read_print()
3219 if (test_type_token(type, token, EVENT_DELIM, ",")) in event_read_print()
3222 free_token(token); in event_read_print()
3231 free_token(token); in event_read_print()
5652 char *token; in parse_header_field() local
5664 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5666 free_token(token); in parse_header_field()
5675 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5677 if (strcmp(token, field) != 0) in parse_header_field()
5679 free_token(token); in parse_header_field()
5688 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5690 *offset = atoi(token); in parse_header_field()
5691 free_token(token); in parse_header_field()
5698 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5700 *size = atoi(token); in parse_header_field()
5701 free_token(token); in parse_header_field()
5704 type = read_token(&token); in parse_header_field()
5710 if (strcmp(token, "signed") != 0) in parse_header_field()
5713 free_token(token); in parse_header_field()
5718 if (read_expect_type(EVENT_ITEM, &token)) in parse_header_field()
5721 free_token(token); in parse_header_field()
5725 if (read_expect_type(EVENT_NEWLINE, &token)) in parse_header_field()
5729 free_token(token); in parse_header_field()
5737 free_token(token); in parse_header_field()