Lines Matching refs:ctx

17 static void configparser_push(config_t *ctx, data_config *dc, int isnew) {  in configparser_push()  argument
19 dc->context_ndx = ctx->all_configs->used; in configparser_push()
20 assert(dc->context_ndx > ctx->current->context_ndx); in configparser_push()
21 array_insert_unique(ctx->all_configs, (data_unset *)dc); in configparser_push()
22 dc->parent = ctx->current; in configparser_push()
25 if (ctx->configs_stack->used > 0 && ctx->current->context_ndx == 0) { in configparser_push()
29 array_insert_unique(ctx->configs_stack, (data_unset *)ctx->current); in configparser_push()
30 ctx->current = dc; in configparser_push()
33 static data_config *configparser_pop(config_t *ctx) { in configparser_pop() argument
34 data_config *old = ctx->current; in configparser_pop()
35 ctx->current = (data_config *) array_pop(ctx->configs_stack); in configparser_pop()
40 static data_unset *configparser_get_variable(config_t *ctx, const buffer *key) { in configparser_get_variable() argument
47 for (dc = ctx->current; dc; dc = dc->parent) { in configparser_get_variable()
174 #define configparserARG_SDECL config_t *ctx;
175 #define configparserARG_PDECL ,config_t *ctx
176 #define configparserARG_FETCH config_t *ctx = yypParser->ctx
177 #define configparserARG_STORE yypParser->ctx = ctx
843 if (ctx->ok) { in yy_reduce()
847 ctx->current->context_ndx, in yy_reduce()
848 ctx->current->key->ptr, yymsp[-2].minor.yy43->ptr); in yy_reduce()
849 ctx->ok = 0; in yy_reduce()
850 } else if (NULL == array_get_element(ctx->current->value, yymsp[0].minor.yy41->key->ptr)) { in yy_reduce()
851 array_insert_unique(ctx->current->value, yymsp[0].minor.yy41); in yy_reduce()
855 ctx->current->context_ndx, in yy_reduce()
856 ctx->current->key->ptr, yymsp[0].minor.yy41->key->ptr); in yy_reduce()
857 ctx->ok = 0; in yy_reduce()
871 array *vars = ctx->current->value; in yy_reduce()
876 ctx->current->context_ndx, in yy_reduce()
877 ctx->current->key->ptr, yymsp[-2].minor.yy43->ptr); in yy_reduce()
878 ctx->ok = 0; in yy_reduce()
883 ctx->ok = 0; in yy_reduce()
890 } else if (NULL != (du = configparser_get_variable(ctx, yymsp[-2].minor.yy43))) { in yy_reduce()
893 ctx->ok = 0; in yy_reduce()
897 array_insert_unique(ctx->current->value, du); in yy_reduce()
902 array_insert_unique(ctx->current->value, yymsp[0].minor.yy41); in yy_reduce()
931 ctx->ok = 0; in yy_reduce()
963 ctx->ok = 0; in yy_reduce()
965 } else if (NULL == (yygotominor.yy41 = configparser_get_variable(ctx, yymsp[0].minor.yy43))) { in yy_reduce()
967 ctx->ok = 0; in yy_reduce()
1037 ctx->ok = 0; in yy_reduce()
1096 dc = (data_config *)array_get_element(ctx->srv->config_context, "global"); in yy_reduce()
1098 configparser_push(ctx, dc, 0); in yy_reduce()
1108 cur = ctx->current; in yy_reduce()
1109 configparser_pop(ctx); in yy_reduce()
1111 assert(cur && ctx->current); in yy_reduce()
1126 ctx->ok = 0; in yy_reduce()
1151 cur = ctx->current; in yy_reduce()
1152 configparser_pop(ctx); in yy_reduce()
1154 assert(cur && ctx->current); in yy_reduce()
1170 if (ctx->ok && yymsp[0].minor.yy41->type != TYPE_STRING) { in yy_reduce()
1172 ctx->ok = 0; in yy_reduce()
1194 buffer_copy_string_buffer(b, ctx->current->key); in yy_reduce()
1202 if (NULL != (dc = (data_config *)array_get_element(ctx->all_configs, b->ptr))) { in yy_reduce()
1203 configparser_push(ctx, dc, 0); in yy_reduce()
1247 ctx->ok = 0; in yy_reduce()
1269 ctx->ok = 0; in yy_reduce()
1275 ctx->ok = 0; in yy_reduce()
1279 ctx->ok = 0; in yy_reduce()
1283 ctx->ok = 0; in yy_reduce()
1291 ctx->ok = 0; in yy_reduce()
1299 ctx->ok = 0; in yy_reduce()
1303 configparser_push(ctx, dc, 1); in yy_reduce()
1356 if (ctx->ok) { in yy_reduce()
1364 ctx->ok = 0; in yy_reduce()
1375 if (ctx->ok) { in yy_reduce()
1376 if (0 != config_parse_file(ctx->srv, ctx, yymsp[0].minor.yy43->ptr)) { in yy_reduce()
1377 ctx->ok = 0; in yy_reduce()
1389 if (ctx->ok) { in yy_reduce()
1390 if (0 != config_parse_cmd(ctx->srv, ctx, yymsp[0].minor.yy43->ptr)) { in yy_reduce()
1391 ctx->ok = 0; in yy_reduce()
1429 ctx->ok = 0; in yy_parse_failed()