Lines Matching refs:tok
855 static int extend_token(char **tok, char *buf, int size) in extend_token() argument
857 char *newtok = realloc(*tok, size); in extend_token()
860 free(*tok); in extend_token()
861 *tok = NULL; in extend_token()
865 if (!*tok) in extend_token()
869 *tok = newtok; in extend_token()
874 static enum event_type force_token(const char *str, char **tok);
876 static enum event_type __read_token(char **tok) in __read_token() argument
884 *tok = NULL; in __read_token()
900 if (asprintf(tok, "%c", ch) < 0) in __read_token()
939 *tok = strdup(buf); in __read_token()
960 if (extend_token(tok, buf, tok_size) < 0) in __read_token()
1002 if (extend_token(tok, buf, tok_size) < 0) in __read_token()
1012 if (extend_token(tok, buf, tok_size + i + 1) < 0) in __read_token()
1024 if (strcmp(*tok, "LOCAL_PR_FMT") == 0) { in __read_token()
1025 free(*tok); in __read_token()
1026 *tok = NULL; in __read_token()
1027 return force_token("\"\%s\" ", tok); in __read_token()
1028 } else if (strcmp(*tok, "STA_PR_FMT") == 0) { in __read_token()
1029 free(*tok); in __read_token()
1030 *tok = NULL; in __read_token()
1031 return force_token("\" sta:%pM\" ", tok); in __read_token()
1032 } else if (strcmp(*tok, "VIF_PR_FMT") == 0) { in __read_token()
1033 free(*tok); in __read_token()
1034 *tok = NULL; in __read_token()
1035 return force_token("\" vif:%p(%d)\" ", tok); in __read_token()
1042 static enum event_type force_token(const char *str, char **tok) in force_token() argument
1056 type = __read_token(tok); in force_token()
1066 static void free_token(char *tok) in free_token() argument
1068 if (tok) in free_token()
1069 free(tok); in free_token()
1072 static enum event_type read_token(char **tok) in read_token() argument
1077 type = __read_token(tok); in read_token()
1081 free_token(*tok); in read_token()
1085 *tok = NULL; in read_token()
1098 enum event_type pevent_read_token(char **tok) in pevent_read_token() argument
1100 return read_token(tok); in pevent_read_token()
1113 static enum event_type read_token_item(char **tok) in read_token_item() argument
1118 type = __read_token(tok); in read_token_item()
1121 free_token(*tok); in read_token_item()
1122 *tok = NULL; in read_token_item()
1126 *tok = NULL; in read_token_item()
1157 static int __read_expect_type(enum event_type expect, char **tok, int newline_ok) in __read_expect_type() argument
1162 type = read_token(tok); in __read_expect_type()
1164 type = read_token_item(tok); in __read_expect_type()
1168 static int read_expect_type(enum event_type expect, char **tok) in read_expect_type() argument
1170 return __read_expect_type(expect, tok, 1); in read_expect_type()
1621 char **tok, enum event_type type);
1624 process_arg(struct event_format *event, struct print_arg *arg, char **tok) in process_arg() argument
1630 *tok = token; in process_arg()
1632 return process_arg_token(event, arg, tok, type); in process_arg()
1636 process_op(struct event_format *event, struct print_arg *arg, char **tok);
1643 process_field_arg(struct event_format *event, struct print_arg *arg, char **tok) in process_field_arg() argument
1647 type = process_arg(event, arg, tok); in process_field_arg()
1650 type = process_op(event, arg, tok); in process_field_arg()
1657 process_cond(struct event_format *event, struct print_arg *top, char **tok) in process_cond() argument
1679 *tok = NULL; in process_cond()
1698 *tok = token; in process_cond()
1710 process_array(struct event_format *event, struct print_arg *top, char **tok) in process_array() argument
1720 *tok = NULL; in process_array()
1724 *tok = NULL; in process_array()
1733 *tok = token; in process_array()
1812 process_op(struct event_format *event, struct print_arg *arg, char **tok) in process_op() argument
1819 token = *tok; in process_op()
1854 *tok = NULL; in process_op()
1855 type = process_arg(event, right, tok); in process_op()
1872 type = process_cond(event, arg, tok); in process_op()
1912 *tok = token; in process_op()
1941 type = process_arg_token(event, right, tok, type); in process_op()
1974 type = process_array(event, arg, tok); in process_op()
1983 if (type == EVENT_OP && strcmp(*tok, ":") != 0) { in process_op()
1987 prio = get_op_prio(*tok); in process_op()
1990 return process_op(event, arg, tok); in process_op()
1992 return process_op(event, right, tok); in process_op()
2001 *tok = NULL; in process_op()
2007 char **tok) in process_entry() argument
2034 *tok = token; in process_entry()
2041 *tok = NULL; in process_entry()
2374 process_fields(struct event_format *event, struct print_flag_sym **list, char **tok) in process_fields() argument
2379 char *token = *tok; in process_fields()
2441 *tok = token; in process_fields()
2449 *tok = NULL; in process_fields()
2455 process_flags(struct event_format *event, struct print_arg *arg, char **tok) in process_flags() argument
2496 type = read_token_item(tok); in process_flags()
2503 *tok = NULL; in process_flags()
2508 process_symbols(struct event_format *event, struct print_arg *arg, char **tok) in process_symbols() argument
2535 type = read_token_item(tok); in process_symbols()
2542 *tok = NULL; in process_symbols()
2547 process_hex(struct event_format *event, struct print_arg *arg, char **tok) in process_hex() argument
2558 return read_token_item(tok); in process_hex()
2563 *tok = NULL; in process_hex()
2568 process_int_array(struct event_format *event, struct print_arg *arg, char **tok) in process_int_array() argument
2582 return read_token_item(tok); in process_int_array()
2589 *tok = NULL; in process_int_array()
2594 process_dynamic_array(struct event_format *event, struct print_arg *arg, char **tok) in process_dynamic_array() argument
2608 *tok = token; in process_dynamic_array()
2626 *tok = token; in process_dynamic_array()
2634 *tok = NULL; in process_dynamic_array()
2646 type = read_token_item(tok); in process_dynamic_array()
2653 *tok = NULL; in process_dynamic_array()
2658 process_paren(struct event_format *event, struct print_arg *arg, char **tok) in process_paren() argument
2710 *tok = token; in process_paren()
2715 *tok = NULL; in process_paren()
2722 char **tok) in process_str() argument
2738 *tok = token; in process_str()
2745 *tok = NULL; in process_str()
2751 char **tok) in process_bitmask() argument
2767 *tok = token; in process_bitmask()
2774 *tok = NULL; in process_bitmask()
2812 struct print_arg *arg, char **tok) in process_func_handler() argument
2823 *tok = NULL; in process_func_handler()
2858 *tok = token; in process_func_handler()
2870 char *token, char **tok) in process_function() argument
2877 return process_flags(event, arg, tok); in process_function()
2882 return process_symbols(event, arg, tok); in process_function()
2886 return process_hex(event, arg, tok); in process_function()
2890 return process_int_array(event, arg, tok); in process_function()
2894 return process_str(event, arg, tok); in process_function()
2898 return process_bitmask(event, arg, tok); in process_function()
2902 return process_dynamic_array(event, arg, tok); in process_function()
2908 return process_func_handler(event, func, arg, tok); in process_function()
2918 char **tok, enum event_type type) in process_arg_token() argument
2923 token = *tok; in process_arg_token()
2954 *tok = NULL; in process_arg_token()
3000 *tok = token; in process_arg_token()