• Home
  • Raw
  • Download

Lines Matching refs:token

1093 void pevent_free_token(char *token)  in pevent_free_token()  argument
1095 free_token(token); in pevent_free_token()
1126 static int test_type_token(enum event_type type, const char *token, in test_type_token() argument
1135 if (strcmp(token, expect_tok) != 0) { in test_type_token()
1137 expect_tok, token); in test_type_token()
1163 char *token; in __read_expected() local
1167 type = read_token(&token); in __read_expected()
1169 type = read_token_item(&token); in __read_expected()
1171 ret = test_type_token(type, token, expect, str); in __read_expected()
1173 free_token(token); in __read_expected()
1190 char *token; in event_read_name() local
1198 if (read_expect_type(EVENT_ITEM, &token) < 0) in event_read_name()
1201 return token; in event_read_name()
1204 free_token(token); in event_read_name()
1210 char *token; in event_read_id() local
1219 if (read_expect_type(EVENT_ITEM, &token) < 0) in event_read_id()
1222 id = strtoul(token, NULL, 0); in event_read_id()
1223 free_token(token); in event_read_id()
1227 free_token(token); in event_read_id()
1290 char *token; in event_read_fields() local
1297 type = read_token(&token); in event_read_fields()
1299 free_token(token); in event_read_fields()
1305 if (test_type_token(type, token, EVENT_ITEM, "field")) in event_read_fields()
1307 free_token(token); in event_read_fields()
1309 type = read_token(&token); in event_read_fields()
1315 type == EVENT_ITEM && strcmp(token, "special") == 0) { in event_read_fields()
1316 free_token(token); in event_read_fields()
1317 type = read_token(&token); in event_read_fields()
1320 if (test_type_token(type, token, EVENT_OP, ":") < 0) in event_read_fields()
1323 free_token(token); in event_read_fields()
1324 if (read_expect_type(EVENT_ITEM, &token) < 0) in event_read_fields()
1327 last_token = token; in event_read_fields()
1337 type = read_token(&token); in event_read_fields()
1339 (type == EVENT_OP && strcmp(token, "*") == 0) || in event_read_fields()
1345 type == EVENT_OP && strcmp(token, ".") == 0)) { in event_read_fields()
1347 if (strcmp(token, "*") == 0) in event_read_fields()
1365 last_token = token; in event_read_fields()
1381 if (strcmp(token, "[") == 0) { in event_read_fields()
1383 char *brackets = token; in event_read_fields()
1389 type = read_token(&token); in event_read_fields()
1392 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1396 while (strcmp(token, "]") != 0) { in event_read_fields()
1406 strlen(token) + len); in event_read_fields()
1414 strcat(brackets, token); in event_read_fields()
1416 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1417 free_token(token); in event_read_fields()
1418 type = read_token(&token); in event_read_fields()
1425 free_token(token); in event_read_fields()
1437 type = read_token(&token); in event_read_fields()
1458 field->name = token; in event_read_fields()
1459 type = read_token(&token); in event_read_fields()
1482 if (test_type_token(type, token, EVENT_OP, ";")) in event_read_fields()
1484 free_token(token); in event_read_fields()
1492 if (read_expect_type(EVENT_ITEM, &token)) in event_read_fields()
1494 field->offset = strtoul(token, NULL, 0); in event_read_fields()
1495 free_token(token); in event_read_fields()
1506 if (read_expect_type(EVENT_ITEM, &token)) in event_read_fields()
1508 field->size = strtoul(token, NULL, 0); in event_read_fields()
1509 free_token(token); in event_read_fields()
1514 type = read_token(&token); in event_read_fields()
1517 if (test_type_token(type, token, EVENT_ITEM, "signed")) in event_read_fields()
1520 free_token(token); in event_read_fields()
1525 if (read_expect_type(EVENT_ITEM, &token)) in event_read_fields()
1528 if (strtoul(token, NULL, 0)) in event_read_fields()
1531 free_token(token); in event_read_fields()
1535 if (read_expect_type(EVENT_NEWLINE, &token)) in event_read_fields()
1539 free_token(token); in event_read_fields()
1563 free_token(token); in event_read_fields()
1575 char *token; in event_read_format() local
1584 if (read_expect_type(EVENT_NEWLINE, &token)) in event_read_format()
1586 free_token(token); in event_read_format()
1601 free_token(token); in event_read_format()
1613 char *token; in process_arg() local
1615 type = read_token(&token); in process_arg()
1616 *tok = token; in process_arg()
1647 char *token = NULL; in process_cond() local
1666 type = process_arg(event, left, &token); in process_cond()
1670 if (type == EVENT_OP && strcmp(token, ":") != 0) { in process_cond()
1671 type = process_op(event, left, &token); in process_cond()
1675 if (test_type_token(type, token, EVENT_OP, ":")) in process_cond()
1678 arg->op.op = token; in process_cond()
1680 type = process_arg(event, right, &token); in process_cond()
1684 *tok = token; in process_cond()
1690 free_token(token); in process_cond()
1700 char *token = NULL; in process_array() local
1711 type = process_arg(event, arg, &token); in process_array()
1712 if (test_type_token(type, token, EVENT_OP, "]")) in process_array()
1717 free_token(token); in process_array()
1718 type = read_token_item(&token); in process_array()
1719 *tok = token; in process_array()
1724 free_token(token); in process_array()
1802 char *token; in process_op() local
1805 token = *tok; in process_op()
1809 if (token[1]) { in process_op()
1810 do_warning_event(event, "bad op token %s", token); in process_op()
1813 switch (token[0]) { in process_op()
1820 do_warning_event(event, "bad op token %s", token); in process_op()
1843 } else if (strcmp(token, "?") == 0) { in process_op()
1853 arg->op.op = token; in process_op()
1860 } else if (strcmp(token, ">>") == 0 || in process_op()
1861 strcmp(token, "<<") == 0 || in process_op()
1862 strcmp(token, "&") == 0 || in process_op()
1863 strcmp(token, "|") == 0 || in process_op()
1864 strcmp(token, "&&") == 0 || in process_op()
1865 strcmp(token, "||") == 0 || in process_op()
1866 strcmp(token, "-") == 0 || in process_op()
1867 strcmp(token, "+") == 0 || in process_op()
1868 strcmp(token, "*") == 0 || in process_op()
1869 strcmp(token, "^") == 0 || in process_op()
1870 strcmp(token, "/") == 0 || in process_op()
1871 strcmp(token, "<") == 0 || in process_op()
1872 strcmp(token, ">") == 0 || in process_op()
1873 strcmp(token, "<=") == 0 || in process_op()
1874 strcmp(token, ">=") == 0 || in process_op()
1875 strcmp(token, "==") == 0 || in process_op()
1876 strcmp(token, "!=") == 0) { in process_op()
1886 arg->op.op = token; in process_op()
1897 type = read_token_item(&token); in process_op()
1898 *tok = token; in process_op()
1902 type == EVENT_DELIM && (strcmp(token, ")") == 0)) { in process_op()
1930 } else if (strcmp(token, "[") == 0) { in process_op()
1939 arg->op.op = token; in process_op()
1948 do_warning_event(event, "unknown op '%s'", token); in process_op()
1971 free_token(token); in process_op()
1982 char *token; in process_entry() local
1987 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_entry()
1989 field = token; in process_entry()
2004 type = read_token(&token); in process_entry()
2005 *tok = token; in process_entry()
2010 free_token(token); in process_entry()
2318 char *token = *tok; in process_fields() local
2322 free_token(token); in process_fields()
2323 type = read_token_item(&token); in process_fields()
2324 if (test_type_token(type, token, EVENT_OP, "{")) in process_fields()
2331 free_token(token); in process_fields()
2332 type = process_arg(event, arg, &token); in process_fields()
2335 type = process_op(event, arg, &token); in process_fields()
2340 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_fields()
2359 free_token(token); in process_fields()
2360 type = process_arg(event, arg, &token); in process_fields()
2361 if (test_type_token(type, token, EVENT_OP, "}")) in process_fields()
2376 free_token(token); in process_fields()
2377 type = read_token_item(&token); in process_fields()
2378 } while (type == EVENT_DELIM && strcmp(token, ",") == 0); in process_fields()
2380 *tok = token; in process_fields()
2387 free_token(token); in process_fields()
2398 char *token = NULL; in process_flags() local
2409 type = process_field_arg(event, field, &token); in process_flags()
2413 type = process_op(event, field, &token); in process_flags()
2415 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_flags()
2417 free_token(token); in process_flags()
2421 type = read_token_item(&token); in process_flags()
2423 arg->flags.delim = token; in process_flags()
2424 type = read_token_item(&token); in process_flags()
2427 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_flags()
2430 type = process_fields(event, &arg->flags.flags, &token); in process_flags()
2431 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_flags()
2434 free_token(token); in process_flags()
2441 free_token(token); in process_flags()
2451 char *token = NULL; in process_symbols() local
2462 type = process_field_arg(event, field, &token); in process_symbols()
2464 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_symbols()
2469 type = process_fields(event, &arg->symbol.symbols, &token); in process_symbols()
2470 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_symbols()
2473 free_token(token); in process_symbols()
2480 free_token(token); in process_symbols()
2490 char *token = NULL; in process_hex() local
2501 type = process_arg(event, field, &token); in process_hex()
2503 if (test_type_token(type, token, EVENT_DELIM, ",")) in process_hex()
2508 free_token(token); in process_hex()
2517 type = process_arg(event, field, &token); in process_hex()
2519 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_hex()
2524 free_token(token); in process_hex()
2530 free_token(token); in process_hex()
2540 char *token; in process_dynamic_array() local
2549 type = read_token(&token); in process_dynamic_array()
2550 *tok = token; in process_dynamic_array()
2556 field = pevent_find_field(event, token); in process_dynamic_array()
2566 free_token(token); in process_dynamic_array()
2567 type = read_token_item(&token); in process_dynamic_array()
2568 *tok = token; in process_dynamic_array()
2569 if (type != EVENT_OP || strcmp(token, "[") != 0) in process_dynamic_array()
2572 free_token(token); in process_dynamic_array()
2580 type = process_arg(event, arg, &token); in process_dynamic_array()
2584 if (!test_type_token(type, token, EVENT_OP, "]")) in process_dynamic_array()
2587 free_token(token); in process_dynamic_array()
2594 free_token(token); in process_dynamic_array()
2604 char *token; in process_paren() local
2606 type = process_arg(event, arg, &token); in process_paren()
2612 type = process_op(event, arg, &token); in process_paren()
2617 if (test_type_token(type, token, EVENT_DELIM, ")")) in process_paren()
2620 free_token(token); in process_paren()
2621 type = read_token_item(&token); in process_paren()
2628 (type == EVENT_DELIM && strcmp(token, "(") == 0)) { in process_paren()
2648 type = process_arg_token(event, item_arg, &token, type); in process_paren()
2652 *tok = token; in process_paren()
2656 free_token(token); in process_paren()
2667 char *token; in process_str() local
2669 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_str()
2673 arg->string.string = token; in process_str()
2679 type = read_token(&token); in process_str()
2680 *tok = token; in process_str()
2685 free_token(token); in process_str()
2696 char *token; in process_bitmask() local
2698 if (read_expect_type(EVENT_ITEM, &token) < 0) in process_bitmask()
2702 arg->bitmask.bitmask = token; in process_bitmask()
2708 type = read_token(&token); in process_bitmask()
2709 *tok = token; in process_bitmask()
2714 free_token(token); in process_bitmask()
2759 char *token; in process_func_handler() local
2776 type = process_arg(event, farg, &token); in process_func_handler()
2778 if (type != EVENT_DELIM || strcmp(token, ",") != 0) { in process_func_handler()
2786 if (type != EVENT_DELIM || strcmp(token, ")") != 0) { in process_func_handler()
2796 free_token(token); in process_func_handler()
2799 type = read_token(&token); in process_func_handler()
2800 *tok = token; in process_func_handler()
2806 free_token(token); in process_func_handler()
2812 char *token, char **tok) in process_function() argument
2816 if (strcmp(token, "__print_flags") == 0) { in process_function()
2817 free_token(token); in process_function()
2821 if (strcmp(token, "__print_symbolic") == 0) { in process_function()
2822 free_token(token); in process_function()
2826 if (strcmp(token, "__print_hex") == 0) { in process_function()
2827 free_token(token); in process_function()
2830 if (strcmp(token, "__get_str") == 0) { in process_function()
2831 free_token(token); in process_function()
2834 if (strcmp(token, "__get_bitmask") == 0) { in process_function()
2835 free_token(token); in process_function()
2838 if (strcmp(token, "__get_dynamic_array") == 0) { in process_function()
2839 free_token(token); in process_function()
2843 func = find_func_handler(event->pevent, token); in process_function()
2845 free_token(token); in process_function()
2849 do_warning_event(event, "function %s not defined", token); in process_function()
2850 free_token(token); in process_function()
2858 char *token; in process_arg_token() local
2861 token = *tok; in process_arg_token()
2865 if (strcmp(token, "REC") == 0) { in process_arg_token()
2866 free_token(token); in process_arg_token()
2867 type = process_entry(event, arg, &token); in process_arg_token()
2870 atom = token; in process_arg_token()
2872 type = read_token_item(&token); in process_arg_token()
2878 if (type == EVENT_DELIM && strcmp(token, "(") == 0) { in process_arg_token()
2879 free_token(token); in process_arg_token()
2880 token = NULL; in process_arg_token()
2882 type = process_function(event, arg, atom, &token); in process_arg_token()
2889 strlen(atom) + strlen(token) + 2); in process_arg_token()
2893 free_token(token); in process_arg_token()
2898 strcat(atom, token); in process_arg_token()
2899 free_token(token); in process_arg_token()
2900 type = read_token_item(&token); in process_arg_token()
2910 arg->atom.atom = token; in process_arg_token()
2911 type = read_token_item(&token); in process_arg_token()
2914 if (strcmp(token, "(") == 0) { in process_arg_token()
2915 free_token(token); in process_arg_token()
2916 type = process_paren(event, arg, &token); in process_arg_token()
2922 arg->op.op = token; in process_arg_token()
2924 type = process_op(event, arg, &token); in process_arg_token()
2938 *tok = token; in process_arg_token()
2947 char *token; in event_read_print_args() local
2952 type = read_token_item(&token); in event_read_print_args()
2963 type = process_arg(event, arg, &token); in event_read_print_args()
2966 free_token(token); in event_read_print_args()
2975 type = process_op(event, arg, &token); in event_read_print_args()
2976 free_token(token); in event_read_print_args()
2986 if (type == EVENT_DELIM && strcmp(token, ",") == 0) { in event_read_print_args()
2987 free_token(token); in event_read_print_args()
2996 free_token(token); in event_read_print_args()
3004 char *token; in event_read_print() local
3016 if (read_expect_type(EVENT_DQUOTE, &token) < 0) in event_read_print()
3020 event->print_fmt.format = token; in event_read_print()
3024 type = read_token_item(&token); in event_read_print()
3033 if (asprintf(&cat, "%s%s", event->print_fmt.format, token) < 0) in event_read_print()
3035 free_token(token); in event_read_print()
3038 token = cat; in event_read_print()
3042 if (test_type_token(type, token, EVENT_DELIM, ",")) in event_read_print()
3045 free_token(token); in event_read_print()
3054 free_token(token); in event_read_print()
4984 char *token; in parse_header_field() local
4996 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
4998 free_token(token); in parse_header_field()
5007 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5009 if (strcmp(token, field) != 0) in parse_header_field()
5011 free_token(token); in parse_header_field()
5020 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5022 *offset = atoi(token); in parse_header_field()
5023 free_token(token); in parse_header_field()
5030 if (read_expect_type(EVENT_ITEM, &token) < 0) in parse_header_field()
5032 *size = atoi(token); in parse_header_field()
5033 free_token(token); in parse_header_field()
5036 type = read_token(&token); in parse_header_field()
5042 if (strcmp(token, "signed") != 0) in parse_header_field()
5045 free_token(token); in parse_header_field()
5050 if (read_expect_type(EVENT_ITEM, &token)) in parse_header_field()
5053 free_token(token); in parse_header_field()
5057 if (read_expect_type(EVENT_NEWLINE, &token)) in parse_header_field()
5061 free_token(token); in parse_header_field()
5069 free_token(token); in parse_header_field()