Lines Matching refs:ctx

2 %extra_argument {config_t *ctx}
14 static void configparser_push(config_t *ctx, data_config *dc, int isnew) { in configparser_push() argument
16 dc->context_ndx = ctx->all_configs->used; in configparser_push()
17 assert(dc->context_ndx > ctx->current->context_ndx); in configparser_push()
18 array_insert_unique(ctx->all_configs, (data_unset *)dc); in configparser_push()
19 dc->parent = ctx->current; in configparser_push()
22 if (ctx->configs_stack->used > 0 && ctx->current->context_ndx == 0) { in configparser_push()
26 array_insert_unique(ctx->configs_stack, (data_unset *)ctx->current); in configparser_push()
27 ctx->current = dc; in configparser_push()
30 static data_config *configparser_pop(config_t *ctx) { in configparser_pop() argument
31 data_config *old = ctx->current; in configparser_pop()
32 ctx->current = (data_config *) array_pop(ctx->configs_stack); in configparser_pop()
37 static data_unset *configparser_get_variable(config_t *ctx, const buffer *key) { in configparser_get_variable() argument
44 for (dc = ctx->current; dc; dc = dc->parent) { in configparser_get_variable()
109 ctx->ok = 0;
147 if (ctx->ok) { in key()
151 ctx->current->context_ndx, in key()
152 ctx->current->key->ptr, A->ptr); in key()
153 ctx->ok = 0; in key()
154 } else if (NULL == array_get_element(ctx->current->value, B->key->ptr)) { in key()
155 array_insert_unique(ctx->current->value, B); in key()
159 ctx->current->context_ndx, in key()
160 ctx->current->key->ptr, B->key->ptr); in key()
161 ctx->ok = 0; in key()
171 array *vars = ctx->current->value; in key()
176 ctx->current->context_ndx, in key()
177 ctx->current->key->ptr, A->ptr); in key()
178 ctx->ok = 0; in key()
183 ctx->ok = 0; in key()
190 } else if (NULL != (du = configparser_get_variable(ctx, A))) { in key()
193 ctx->ok = 0; in key()
197 array_insert_unique(ctx->current->value, du); in key()
202 array_insert_unique(ctx->current->value, B); in key()
224 ctx->ok = 0; in expression()
249 ctx->ok = 0; in value()
251 } else if (NULL == (A = configparser_get_variable(ctx, B))) { in value()
253 ctx->ok = 0; in value()
298 ctx->ok = 0; in aelements()
336 dc = (data_config *)array_get_element(ctx->srv->config_context, "global");
338 configparser_push(ctx, dc, 0);
344 cur = ctx->current; in global()
345 configparser_pop(ctx); in global()
347 assert(cur && ctx->current); in global()
355 ctx->ok = 0; in condlines()
372 cur = ctx->current; in condline()
373 configparser_pop(ctx); in condline()
375 assert(cur && ctx->current); in condline()
384 if (ctx->ok && D->type != TYPE_STRING) { in SRVVARNAME()
386 ctx->ok = 0; in SRVVARNAME()
408 buffer_copy_string_buffer(b, ctx->current->key); in SRVVARNAME()
416 if (NULL != (dc = (data_config *)array_get_element(ctx->all_configs, b->ptr))) { in SRVVARNAME()
417 configparser_push(ctx, dc, 0); in SRVVARNAME()
461 ctx->ok = 0; in SRVVARNAME()
483 ctx->ok = 0; in SRVVARNAME()
489 ctx->ok = 0; in SRVVARNAME()
493 ctx->ok = 0; in SRVVARNAME()
497 ctx->ok = 0; in SRVVARNAME()
505 ctx->ok = 0; in SRVVARNAME()
513 ctx->ok = 0; in SRVVARNAME()
517 configparser_push(ctx, dc, 1); in SRVVARNAME()
544 if (ctx->ok) { in stringop()
552 ctx->ok = 0; in stringop()
560 if (ctx->ok) { in stringop()
561 if (0 != config_parse_file(ctx->srv, ctx, A->ptr)) { in stringop()
562 ctx->ok = 0; in stringop()
570 if (ctx->ok) { in stringop()
571 if (0 != config_parse_cmd(ctx->srv, ctx, A->ptr)) { in stringop()
572 ctx->ok = 0; in stringop()