Lines Matching refs:token

1107 void pevent_free_token(char *token)  in pevent_free_token()  argument
1109 free_token(token); in pevent_free_token()
1140 static int test_type_token(enum event_type type, const char *token, in test_type_token() argument
1149 if (strcmp(token, expect_tok) != 0) { in test_type_token()
1151 expect_tok, token); in test_type_token()
1177 char *token; in __read_expected() local
1181 type = read_token(&token); in __read_expected()
1183 type = read_token_item(&token); in __read_expected()
1185 ret = test_type_token(type, token, expect, str); in __read_expected()
1187 free_token(token); in __read_expected()
1204 char *token; in event_read_name() local
1212 if (read_expect_type(EVENT_ITEM, &token) < 0) in event_read_name()
1215 return token; in event_read_name()
1218 free_token(token); in event_read_name()
1224 char *token; in event_read_id() local
1233 if (read_expect_type(EVENT_ITEM, &token) < 0) in event_read_id()
1236 id = strtoul(token, NULL, 0); in event_read_id()
1237 free_token(token); in event_read_id()
1241 free_token(token); in event_read_id()
1304 char *token; in event_read_fields() local
1311 type = read_token(&token); in event_read_fields()
1313 free_token(token); in event_read_fields()
1319 if (test_type_token(type, token, EVENT_ITEM, "field")) in event_read_fields()
1321 free_token(token); in event_read_fields()
1323 type = read_token(&token); in event_read_fields()
1329 type == EVENT_ITEM && strcmp(token, "special") == 0) { in event_read_fields()
1330 free_token(token); in event_read_fields()
1331 type = read_token(&token); in event_read_fields()
1334 if (test_type_token(type, token, EVENT_OP, ":") < 0) in event_read_fields()
1337 free_token(token); in event_read_fields()
1338 if (read_expect_type(EVENT_ITEM, &token) < 0) in event_read_fields()
1341 last_token = token; in event_read_fields()
1351 type = read_token(&token); in event_read_fields()
1353 (type == EVENT_OP && strcmp(token, "*") == 0) || in event_read_fields()
1359 type == EVENT_OP && strcmp(token, ".") == 0)) { in event_read_fields()
1361 if (strcmp(token, "*") == 0) in event_read_fields()
1379 last_token = token; in event_read_fields()
1395 if (strcmp(token, "[") == 0) { in event_read_fields()
1397 char *brackets = token; in event_read_fields()
1403 type = read_token(&token); in event_read_fields()
1406 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1410 while (strcmp(token, "]") != 0) { in event_read_fields()
1420 strlen(token) + len); in event_read_fields()
1428 strcat(brackets, token); in event_read_fields()
1430 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1431 free_token(token); in event_read_fields()
1432 type = read_token(&token); in event_read_fields()
1439 free_token(token); in event_read_fields()
1451 type = read_token(&token); in event_read_fields()
1472 field->name = token; in event_read_fields()
1473 type = read_token(&token); in event_read_fields()
1496 if (test_type_token(type, token, EVENT_OP, ";")) in event_read_fields()
1498 free_token(token); in event_read_fields()
1506 if (read_expect_type(EVENT_ITEM, &token)) in event_read_fields()
1508 field->offset = strtoul(token, NULL, 0); in event_read_fields()
1509 free_token(token); in event_read_fields()
1520 if (read_expect_type(EVENT_ITEM, &token)) in event_read_fields()
1522 field->size = strtoul(token, NULL, 0); in event_read_fields()
1523 free_token(token); in event_read_fields()
1528 type = read_token(&token); in event_read_fields()
1531 if (test_type_token(type, token, EVENT_ITEM, "signed")) in event_read_fields()
1534 free_token(token); in event_read_fields()
1539 if (read_expect_type(EVENT_ITEM, &token)) in event_read_fields()
1542 if (strtoul(token, NULL, 0)) in event_read_fields()
1545 free_token(token); in event_read_fields()
1549 if (read_expect_type(EVENT_NEWLINE, &token)) in event_read_fields()
1553 free_token(token); in event_read_fields()
1577 free_token(token); in event_read_fields()
1589 char *token; in event_read_format() local
1598 if (read_expect_type(EVENT_NEWLINE, &token)) in event_read_format()
1600 free_token(token); in event_read_format()
1615 free_token(token); in event_read_format()
1627 char *token; in process_arg() local
1629 type = read_token(&token); in process_arg()
1630 *tok = token; in process_arg()
1661 char *token = NULL; in process_cond() local
1680 type = process_arg(event, left, &token); in process_cond()
1684 if (type == EVENT_OP && strcmp(token, ":") != 0) { in process_cond()
1685 type = process_op(event, left, &token); in process_cond()
1689 if (test_type_token(type, token, EVENT_OP, ":")) in process_cond()
1692 arg->op.op = token; in process_cond()
1694 type = process_arg(event, right, &token); in process_cond()
1698 *tok = token; in process_cond()
1704 free_token(token); in process_cond()
1714 char *token = NULL; in process_array() local
1725 type = process_arg(event, arg, &token); in process_array()
1726 if (test_type_token(type, token, EVENT_OP, "]")) in process_array()
1731 free_token(token); in process_array()
1732 type = read_token_item(&token); in process_array()
1733 *tok = token; in process_array()
1738 free_token(token); in process_array()
1816 char *token; in process_op() local
1819 token = *tok; in process_op()
1823 if (token[1]) { in process_op()
1824 do_warning_event(event, "bad op token %s", token); in process_op()
1827 switch (token[0]) { in process_op()
1834 do_warning_event(event, "bad op token %s", token); in process_op()
1857 } else if (strcmp(token, "?") == 0) { in process_op()
1867 arg->op.op = token; in process_op()
1874 } else if (strcmp(token, ">>") == 0 || in process_op()
1875 strcmp(token, "<<") == 0 || in process_op()
1876 strcmp(token, "&") == 0 || in process_op()
1877 strcmp(token, "|") == 0 || in process_op()
1878 strcmp(token, "&&") == 0 || in process_op()
1879 strcmp(token, "||") == 0 || in process_op()
1880 strcmp(token, "-") == 0 || in process_op()
1881 strcmp(token, "+") == 0 || in process_op()
1882 strcmp(token, "*") == 0 || in process_op()
1883 strcmp(token, "^") == 0 || in process_op()
1884 strcmp(token, "/") == 0 || in process_op()
1885 strcmp(token, "<") == 0 || in process_op()
1886 strcmp(token, ">") == 0 || in process_op()
1887 strcmp(token, "<=") == 0 || in process_op()
1888 strcmp(token, ">=") == 0 || in process_op()
1889 strcmp(token, "==") == 0 || in process_op()
1890 strcmp(token, "!=") == 0) { in process_op()
1900 arg->op.op = token; in process_op()
1911 type = read_token_item(&token); in process_op()
1912 *tok = token; in process_op()
1916 type == EVENT_DELIM && (strcmp(token, ")") == 0)) { in process_op()
1959 } else if (strcmp(token, "[") == 0) { in process_op()
1968 arg->op.op = token; in process_op()
1977 do_warning_event(event, "unknown op '%s'", token); in process_op()
2000 free_token(token); in process_op()
2011 char *token; in process_entry() local
2016 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_entry()
2018 field = token; in process_entry()
2033 type = read_token(&token); in process_entry()
2034 *tok = token; in process_entry()
2039 free_token(token); in process_entry()
2050 char *token; in alloc_and_process_delim() local
2060 type = process_arg(event, field, &token); in alloc_and_process_delim()
2062 if (test_type_token(type, token, EVENT_DELIM, next_token)) { in alloc_and_process_delim()
2072 free_token(token); in alloc_and_process_delim()
2379 char *token = *tok; in process_fields() local
2383 free_token(token); in process_fields()
2384 type = read_token_item(&token); in process_fields()
2385 if (test_type_token(type, token, EVENT_OP, "{")) in process_fields()
2392 free_token(token); in process_fields()
2393 type = process_arg(event, arg, &token); in process_fields()
2396 type = process_op(event, arg, &token); in process_fields()
2401 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_fields()
2420 free_token(token); in process_fields()
2421 type = process_arg(event, arg, &token); in process_fields()
2422 if (test_type_token(type, token, EVENT_OP, "}")) in process_fields()
2437 free_token(token); in process_fields()
2438 type = read_token_item(&token); in process_fields()
2439 } while (type == EVENT_DELIM && strcmp(token, ",") == 0); in process_fields()
2441 *tok = token; in process_fields()
2448 free_token(token); in process_fields()
2459 char *token = NULL; in process_flags() local
2470 type = process_field_arg(event, field, &token); in process_flags()
2474 type = process_op(event, field, &token); in process_flags()
2476 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_flags()
2478 free_token(token); in process_flags()
2482 type = read_token_item(&token); in process_flags()
2484 arg->flags.delim = token; in process_flags()
2485 type = read_token_item(&token); in process_flags()
2488 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_flags()
2491 type = process_fields(event, &arg->flags.flags, &token); in process_flags()
2492 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_flags()
2495 free_token(token); in process_flags()
2502 free_token(token); in process_flags()
2512 char *token = NULL; in process_symbols() local
2523 type = process_field_arg(event, field, &token); in process_symbols()
2525 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_symbols()
2530 type = process_fields(event, &arg->symbol.symbols, &token); in process_symbols()
2531 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_symbols()
2534 free_token(token); in process_symbols()
2541 free_token(token); in process_symbols()
2598 char *token; in process_dynamic_array() local
2607 type = read_token(&token); in process_dynamic_array()
2608 *tok = token; in process_dynamic_array()
2614 field = pevent_find_field(event, token); in process_dynamic_array()
2624 free_token(token); in process_dynamic_array()
2625 type = read_token_item(&token); in process_dynamic_array()
2626 *tok = token; in process_dynamic_array()
2627 if (type != EVENT_OP || strcmp(token, "[") != 0) in process_dynamic_array()
2630 free_token(token); in process_dynamic_array()
2638 type = process_arg(event, arg, &token); in process_dynamic_array()
2642 if (!test_type_token(type, token, EVENT_OP, "]")) in process_dynamic_array()
2645 free_token(token); in process_dynamic_array()
2652 free_token(token); in process_dynamic_array()
2662 char *token; in process_paren() local
2664 type = process_arg(event, arg, &token); in process_paren()
2670 type = process_op(event, arg, &token); in process_paren()
2675 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_paren()
2678 free_token(token); in process_paren()
2679 type = read_token_item(&token); in process_paren()
2686 (type == EVENT_DELIM && strcmp(token, "(") == 0)) { in process_paren()
2706 type = process_arg_token(event, item_arg, &token, type); in process_paren()
2710 *tok = token; in process_paren()
2714 free_token(token); in process_paren()
2725 char *token; in process_str() local
2727 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_str()
2731 arg->string.string = token; in process_str()
2737 type = read_token(&token); in process_str()
2738 *tok = token; in process_str()
2743 free_token(token); in process_str()
2754 char *token; in process_bitmask() local
2756 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_bitmask()
2760 arg->bitmask.bitmask = token; in process_bitmask()
2766 type = read_token(&token); in process_bitmask()
2767 *tok = token; in process_bitmask()
2772 free_token(token); in process_bitmask()
2817 char *token; in process_func_handler() local
2834 type = process_arg(event, farg, &token); in process_func_handler()
2836 if (type != EVENT_DELIM || strcmp(token, ",") != 0) { in process_func_handler()
2844 if (type != EVENT_DELIM || strcmp(token, ")") != 0) { in process_func_handler()
2854 free_token(token); in process_func_handler()
2857 type = read_token(&token); in process_func_handler()
2858 *tok = token; in process_func_handler()
2864 free_token(token); in process_func_handler()
2870 char *token, char **tok) in process_function() argument
2874 if (strcmp(token, "__print_flags") == 0) { in process_function()
2875 free_token(token); in process_function()
2879 if (strcmp(token, "__print_symbolic") == 0) { in process_function()
2880 free_token(token); in process_function()
2884 if (strcmp(token, "__print_hex") == 0) { in process_function()
2885 free_token(token); in process_function()
2888 if (strcmp(token, "__print_array") == 0) { in process_function()
2889 free_token(token); in process_function()
2892 if (strcmp(token, "__get_str") == 0) { in process_function()
2893 free_token(token); in process_function()
2896 if (strcmp(token, "__get_bitmask") == 0) { in process_function()
2897 free_token(token); in process_function()
2900 if (strcmp(token, "__get_dynamic_array") == 0) { in process_function()
2901 free_token(token); in process_function()
2905 func = find_func_handler(event->pevent, token); in process_function()
2907 free_token(token); in process_function()
2911 do_warning_event(event, "function %s not defined", token); in process_function()
2912 free_token(token); in process_function()
2920 char *token; in process_arg_token() local
2923 token = *tok; in process_arg_token()
2927 if (strcmp(token, "REC") == 0) { in process_arg_token()
2928 free_token(token); in process_arg_token()
2929 type = process_entry(event, arg, &token); in process_arg_token()
2932 atom = token; in process_arg_token()
2934 type = read_token_item(&token); in process_arg_token()
2940 if (type == EVENT_DELIM && strcmp(token, "(") == 0) { in process_arg_token()
2941 free_token(token); in process_arg_token()
2942 token = NULL; in process_arg_token()
2944 type = process_function(event, arg, atom, &token); in process_arg_token()
2951 strlen(atom) + strlen(token) + 2); in process_arg_token()
2955 free_token(token); in process_arg_token()
2960 strcat(atom, token); in process_arg_token()
2961 free_token(token); in process_arg_token()
2962 type = read_token_item(&token); in process_arg_token()
2972 arg->atom.atom = token; in process_arg_token()
2973 type = read_token_item(&token); in process_arg_token()
2976 if (strcmp(token, "(") == 0) { in process_arg_token()
2977 free_token(token); in process_arg_token()
2978 type = process_paren(event, arg, &token); in process_arg_token()
2984 arg->op.op = token; in process_arg_token()
2986 type = process_op(event, arg, &token); in process_arg_token()
3000 *tok = token; in process_arg_token()
3009 char *token; in event_read_print_args() local
3014 type = read_token_item(&token); in event_read_print_args()
3025 type = process_arg(event, arg, &token); in event_read_print_args()
3028 free_token(token); in event_read_print_args()
3037 type = process_op(event, arg, &token); in event_read_print_args()
3038 free_token(token); in event_read_print_args()
3048 if (type == EVENT_DELIM && strcmp(token, ",") == 0) { in event_read_print_args()
3049 free_token(token); in event_read_print_args()
3058 free_token(token); in event_read_print_args()
3066 char *token; in event_read_print() local
3078 if (read_expect_type(EVENT_DQUOTE, &token) < 0) in event_read_print()
3082 event->print_fmt.format = token; in event_read_print()
3086 type = read_token_item(&token); in event_read_print()
3095 if (asprintf(&cat, "%s%s", event->print_fmt.format, token) < 0) in event_read_print()
3097 free_token(token); in event_read_print()
3100 token = cat; in event_read_print()
3104 if (test_type_token(type, token, EVENT_DELIM, ",")) in event_read_print()
3107 free_token(token); in event_read_print()
3116 free_token(token); in event_read_print()
5525 char *token; in parse_header_field() local
5537 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5539 free_token(token); in parse_header_field()
5548 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5550 if (strcmp(token, field) != 0) in parse_header_field()
5552 free_token(token); in parse_header_field()
5561 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5563 *offset = atoi(token); in parse_header_field()
5564 free_token(token); in parse_header_field()
5571 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5573 *size = atoi(token); in parse_header_field()
5574 free_token(token); in parse_header_field()
5577 type = read_token(&token); in parse_header_field()
5583 if (strcmp(token, "signed") != 0) in parse_header_field()
5586 free_token(token); in parse_header_field()
5591 if (read_expect_type(EVENT_ITEM, &token)) in parse_header_field()
5594 free_token(token); in parse_header_field()
5598 if (read_expect_type(EVENT_NEWLINE, &token)) in parse_header_field()
5602 free_token(token); in parse_header_field()
5610 free_token(token); in parse_header_field()