Lines Matching refs:tok
921 static int extend_token(char **tok, char *buf, int size) in extend_token() argument
923 char *newtok = realloc(*tok, size); in extend_token()
926 free(*tok); in extend_token()
927 *tok = NULL; in extend_token()
931 if (!*tok) in extend_token()
935 *tok = newtok; in extend_token()
940 static enum event_type force_token(const char *str, char **tok);
942 static enum event_type __read_token(char **tok) in __read_token() argument
950 *tok = NULL; in __read_token()
966 if (asprintf(tok, "%c", ch) < 0) in __read_token()
1005 *tok = strdup(buf); in __read_token()
1026 if (extend_token(tok, buf, tok_size) < 0) in __read_token()
1068 if (extend_token(tok, buf, tok_size) < 0) in __read_token()
1078 if (extend_token(tok, buf, tok_size + i + 1) < 0) in __read_token()
1090 if (strcmp(*tok, "LOCAL_PR_FMT") == 0) { in __read_token()
1091 free(*tok); in __read_token()
1092 *tok = NULL; in __read_token()
1093 return force_token("\"\%s\" ", tok); in __read_token()
1094 } else if (strcmp(*tok, "STA_PR_FMT") == 0) { in __read_token()
1095 free(*tok); in __read_token()
1096 *tok = NULL; in __read_token()
1097 return force_token("\" sta:%pM\" ", tok); in __read_token()
1098 } else if (strcmp(*tok, "VIF_PR_FMT") == 0) { in __read_token()
1099 free(*tok); in __read_token()
1100 *tok = NULL; in __read_token()
1101 return force_token("\" vif:%p(%d)\" ", tok); in __read_token()
1108 static enum event_type force_token(const char *str, char **tok) in force_token() argument
1122 type = __read_token(tok); in force_token()
1132 static void free_token(char *tok) in free_token() argument
1134 if (tok) in free_token()
1135 free(tok); in free_token()
1138 static enum event_type read_token(char **tok) in read_token() argument
1143 type = __read_token(tok); in read_token()
1147 free_token(*tok); in read_token()
1151 *tok = NULL; in read_token()
1164 enum event_type pevent_read_token(char **tok) in pevent_read_token() argument
1166 return read_token(tok); in pevent_read_token()
1179 static enum event_type read_token_item(char **tok) in read_token_item() argument
1184 type = __read_token(tok); in read_token_item()
1187 free_token(*tok); in read_token_item()
1188 *tok = NULL; in read_token_item()
1192 *tok = NULL; in read_token_item()
1223 static int __read_expect_type(enum event_type expect, char **tok, int newline_ok) in __read_expect_type() argument
1228 type = read_token(tok); in __read_expect_type()
1230 type = read_token_item(tok); in __read_expect_type()
1234 static int read_expect_type(enum event_type expect, char **tok) in read_expect_type() argument
1236 return __read_expect_type(expect, tok, 1); in read_expect_type()
1687 char **tok, enum event_type type);
1690 process_arg(struct event_format *event, struct print_arg *arg, char **tok) in process_arg() argument
1696 *tok = token; in process_arg()
1698 return process_arg_token(event, arg, tok, type); in process_arg()
1702 process_op(struct event_format *event, struct print_arg *arg, char **tok);
1709 process_field_arg(struct event_format *event, struct print_arg *arg, char **tok) in process_field_arg() argument
1713 type = process_arg(event, arg, tok); in process_field_arg()
1716 type = process_op(event, arg, tok); in process_field_arg()
1723 process_cond(struct event_format *event, struct print_arg *top, char **tok) in process_cond() argument
1745 *tok = NULL; in process_cond()
1767 *tok = token; in process_cond()
1779 process_array(struct event_format *event, struct print_arg *top, char **tok) in process_array() argument
1789 *tok = NULL; in process_array()
1793 *tok = NULL; in process_array()
1802 *tok = token; in process_array()
1881 process_op(struct event_format *event, struct print_arg *arg, char **tok) in process_op() argument
1888 token = *tok; in process_op()
1923 *tok = NULL; in process_op()
1924 type = process_arg(event, right, tok); in process_op()
1941 type = process_cond(event, arg, tok); in process_op()
1981 *tok = token; in process_op()
2010 type = process_arg_token(event, right, tok, type); in process_op()
2049 type = process_array(event, arg, tok); in process_op()
2058 if (type == EVENT_OP && strcmp(*tok, ":") != 0) { in process_op()
2062 prio = get_op_prio(*tok); in process_op()
2065 return process_op(event, arg, tok); in process_op()
2067 return process_op(event, right, tok); in process_op()
2076 *tok = NULL; in process_op()
2082 char **tok) in process_entry() argument
2109 *tok = token; in process_entry()
2116 *tok = NULL; in process_entry()
2449 process_fields(struct event_format *event, struct print_flag_sym **list, char **tok) in process_fields() argument
2454 char *token = *tok; in process_fields()
2516 *tok = token; in process_fields()
2524 *tok = NULL; in process_fields()
2530 process_flags(struct event_format *event, struct print_arg *arg, char **tok) in process_flags() argument
2571 type = read_token_item(tok); in process_flags()
2578 *tok = NULL; in process_flags()
2583 process_symbols(struct event_format *event, struct print_arg *arg, char **tok) in process_symbols() argument
2610 type = read_token_item(tok); in process_symbols()
2617 *tok = NULL; in process_symbols()
2622 process_hex(struct event_format *event, struct print_arg *arg, char **tok) in process_hex() argument
2633 return read_token_item(tok); in process_hex()
2638 *tok = NULL; in process_hex()
2643 process_int_array(struct event_format *event, struct print_arg *arg, char **tok) in process_int_array() argument
2657 return read_token_item(tok); in process_int_array()
2664 *tok = NULL; in process_int_array()
2669 process_dynamic_array(struct event_format *event, struct print_arg *arg, char **tok) in process_dynamic_array() argument
2683 *tok = token; in process_dynamic_array()
2701 *tok = token; in process_dynamic_array()
2709 *tok = NULL; in process_dynamic_array()
2721 type = read_token_item(tok); in process_dynamic_array()
2728 *tok = NULL; in process_dynamic_array()
2734 char **tok) in process_dynamic_array_len() argument
2757 *tok = token; in process_dynamic_array_len()
2764 *tok = NULL; in process_dynamic_array_len()
2769 process_paren(struct event_format *event, struct print_arg *arg, char **tok) in process_paren() argument
2821 *tok = token; in process_paren()
2826 *tok = NULL; in process_paren()
2833 char **tok) in process_str() argument
2849 *tok = token; in process_str()
2856 *tok = NULL; in process_str()
2862 char **tok) in process_bitmask() argument
2878 *tok = token; in process_bitmask()
2885 *tok = NULL; in process_bitmask()
2923 struct print_arg *arg, char **tok) in process_func_handler() argument
2934 *tok = NULL; in process_func_handler()
2969 *tok = token; in process_func_handler()
2981 char *token, char **tok) in process_function() argument
2988 return process_flags(event, arg, tok); in process_function()
2993 return process_symbols(event, arg, tok); in process_function()
2997 return process_hex(event, arg, tok); in process_function()
3001 return process_int_array(event, arg, tok); in process_function()
3005 return process_str(event, arg, tok); in process_function()
3009 return process_bitmask(event, arg, tok); in process_function()
3013 return process_dynamic_array(event, arg, tok); in process_function()
3017 return process_dynamic_array_len(event, arg, tok); in process_function()
3023 return process_func_handler(event, func, arg, tok); in process_function()
3033 char **tok, enum event_type type) in process_arg_token() argument
3038 token = *tok; in process_arg_token()
3069 *tok = NULL; in process_arg_token()
3115 *tok = token; in process_arg_token()