Lines Matching refs:ctx
20 static size_t key_hash(const void *key, void *ctx __maybe_unused) in key_hash()
34 void *ctx __maybe_unused) in key_equal()
40 int expr__add_id(struct expr_parse_ctx *ctx, const char *id) in expr__add_id() argument
50 data_ptr->parent = ctx->parent; in expr__add_id()
52 ret = hashmap__set(&ctx->ids, id, data_ptr, in expr__add_id()
62 int expr__add_id_val(struct expr_parse_ctx *ctx, const char *id, double val) in expr__add_id_val() argument
74 ret = hashmap__set(&ctx->ids, id, data_ptr, in expr__add_id_val()
83 int expr__add_ref(struct expr_parse_ctx *ctx, struct metric_ref *ref) in expr__add_ref() argument
120 ret = hashmap__set(&ctx->ids, name, data_ptr, in expr__add_ref()
133 int expr__get_id(struct expr_parse_ctx *ctx, const char *id, in expr__get_id() argument
136 return hashmap__find(&ctx->ids, id, (void **)data) ? 0 : -1; in expr__get_id()
139 int expr__resolve_id(struct expr_parse_ctx *ctx, const char *id, in expr__resolve_id() argument
144 if (expr__get_id(ctx, id, datap) || !*datap) { in expr__resolve_id()
157 if (expr__parse(&data->val, ctx, data->ref.metric_expr, 1)) { in expr__resolve_id()
167 void expr__del_id(struct expr_parse_ctx *ctx, const char *id) in expr__del_id() argument
172 hashmap__delete(&ctx->ids, id, in expr__del_id()
178 void expr__ctx_init(struct expr_parse_ctx *ctx) in expr__ctx_init() argument
180 hashmap__init(&ctx->ids, key_hash, key_equal, NULL); in expr__ctx_init()
183 void expr__ctx_clear(struct expr_parse_ctx *ctx) in expr__ctx_clear() argument
188 hashmap__for_each_entry((&ctx->ids), cur, bkt) { in expr__ctx_clear()
192 hashmap__clear(&ctx->ids); in expr__ctx_clear()
196 __expr__parse(double *val, struct expr_parse_ctx *ctx, const char *expr, in __expr__parse() argument
220 ret = expr_parse(val, ctx, scanner); in __expr__parse()
228 int expr__parse(double *final_val, struct expr_parse_ctx *ctx, in expr__parse() argument
231 return __expr__parse(final_val, ctx, expr, EXPR_PARSE, runtime) ? -1 : 0; in expr__parse()
235 struct expr_parse_ctx *ctx, int runtime) in expr__find_other() argument
237 int ret = __expr__parse(NULL, ctx, expr, EXPR_OTHER, runtime); in expr__find_other()
240 expr__del_id(ctx, one); in expr__find_other()