Lines Matching refs:dc
38 static void configparser_push_data_config_list(data_config_list *v, data_config *dc) { in configparser_push_data_config_list() argument
43 v->data[v->used++] = dc; in configparser_push_data_config_list()
46 static void configparser_push(config_t *ctx, data_config *dc, int isnew) { in configparser_push() argument
48 dc->context_ndx = ctx->all_configs->used; in configparser_push()
49 force_assert(dc->context_ndx > ctx->current->context_ndx); in configparser_push()
50 array_insert_unique(ctx->all_configs, (data_unset *)dc); in configparser_push()
51 dc->parent = ctx->current; in configparser_push()
52 configparser_push_data_config_list(&dc->parent->children, dc); in configparser_push()
59 ctx->current = dc; in configparser_push()
73 data_config *dc; in configparser_get_variable() local
78 for (dc = ctx->current; dc; dc = dc->parent) { in configparser_get_variable()
80 fprintf(stderr, "get var on block: %s\n", dc->key.ptr); in configparser_get_variable()
81 array_print(dc->value, 0); in configparser_get_variable()
83 if (NULL != (du = array_get_element_klen(dc->value, BUF_PTR_LEN(key)))) { in configparser_get_variable()
278 data_config *dc; in configparser_parse_condition() local
279 if (NULL != (dc = configparser_get_data_config(ctx->all_configs, in configparser_parse_condition()
281 configparser_push(ctx, dc, 0); in configparser_parse_condition()
284 dc = data_config_init(); in configparser_parse_condition()
285 dc->cond = cond; in configparser_parse_condition()
286 dc->comp = comp; in configparser_parse_condition()
288 buffer_copy_buffer(&dc->key, tb); in configparser_parse_condition()
289 buffer_copy_buffer(&dc->comp_tag, comp_tag); in configparser_parse_condition()
290 dc->comp_key = dc->key.ptr + comp_offset; in configparser_parse_condition()
292 if (COMP_UNSET == dc->comp) { in configparser_parse_condition()
293 fprintf(stderr, "error comp_key %s", dc->comp_key); in configparser_parse_condition()
296 else if (COMP_HTTP_LANGUAGE == dc->comp) { in configparser_parse_condition()
297 dc->comp = COMP_HTTP_REQUEST_HEADER; in configparser_parse_condition()
298 buffer_copy_string_len(&dc->comp_tag, CONST_STR_LEN("Accept-Language")); in configparser_parse_condition()
300 else if (COMP_HTTP_USER_AGENT == dc->comp) { in configparser_parse_condition()
301 dc->comp = COMP_HTTP_REQUEST_HEADER; in configparser_parse_condition()
302 buffer_copy_string_len(&dc->comp_tag, CONST_STR_LEN("User-Agent")); in configparser_parse_condition()
304 else if (COMP_HTTP_REMOTE_IP == dc->comp in configparser_parse_condition()
305 && (dc->cond == CONFIG_COND_EQ || in configparser_parse_condition()
306 dc->cond == CONFIG_COND_NE || in configparser_parse_condition()
307 dc->cond == CONFIG_COND_PREFIX || in configparser_parse_condition()
308 dc->cond == CONFIG_COND_SUFFIX)) { in configparser_parse_condition()
314 else if (COMP_SERVER_SOCKET == dc->comp) { in configparser_parse_condition()
325 else if (COMP_HTTP_HOST == dc->comp) { in configparser_parse_condition()
326 if (dc->cond == CONFIG_COND_EQ || in configparser_parse_condition()
327 dc->cond == CONFIG_COND_NE || in configparser_parse_condition()
328 dc->cond == CONFIG_COND_PREFIX || in configparser_parse_condition()
329 dc->cond == CONFIG_COND_SUFFIX) { in configparser_parse_condition()
337 if (COMP_HTTP_REQUEST_HEADER == dc->comp) { in configparser_parse_condition()
338 dc->ext = http_header_hkey_get(BUF_PTR_LEN(&dc->comp_tag)); in configparser_parse_condition()
341 buffer_move(&dc->string, rvalue); in configparser_parse_condition()
344 configparser_push(ctx, dc, 1); in configparser_parse_condition()
346 dc->fn->free((data_unset*) dc); in configparser_parse_condition()
353 data_config * const dc = data_config_init(); in configparser_parse_else_condition() local
354 dc->cond = CONFIG_COND_ELSE; in configparser_parse_else_condition()
355 buffer_append_str2(&dc->key, BUF_PTR_LEN(&ctx->current->key), in configparser_parse_else_condition()
358 configparser_push(ctx, dc, 1); in configparser_parse_else_condition()
629 data_config *dc; variable
630 dc = configparser_get_data_config(ctx->srv->config_context, CONST_STR_LEN("global"));
631 force_assert(dc);
632 configparser_push(ctx, dc, 0);
672 data_config *dc; in condlines() local
673 dc = (data_config *)array_extract_element_klen(ctx->all_configs, BUF_PTR_LEN(&C->key)); in condlines()
674 force_assert(C == dc); in condlines()
710 if (NULL == (dc = configparser_get_data_config(ctx->all_configs, BUF_PTR_LEN(&C->key)))) { in condlines()
719 C = dc; in condlines()