summaryrefslogtreecommitdiff
path: root/src/configparser.y
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2021-05-20 16:58:53 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2021-05-20 17:56:51 -0400
commit4f8f83ea1d8fbabbc165fa45395a608d2ed6f5e5 (patch)
tree3e9a07c95bcabf5226d225cbbae9f0488d780f8c /src/configparser.y
parentfbe55825b417a71e9cced7f977cf5759ebf3bcb2 (diff)
downloadlighttpd-git-4f8f83ea1d8fbabbc165fa45395a608d2ed6f5e5.tar.gz
[core] move data_{array,integer,string} to array.c
move native data_* types into array.c (the types are already declared in array.h) The array data structure remains extendable, as is done with data_config (configfile) and data_auth (mod_auth), though array data structure primary uses are at startup (config time) and header parsing. The insertion logic into sorted list can be expensive for large lists, so header parsing might choose a different data structure in the future.
Diffstat (limited to 'src/configparser.y')
-rw-r--r--src/configparser.y14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/configparser.y b/src/configparser.y
index ef104b4b..932c1431 100644
--- a/src/configparser.y
+++ b/src/configparser.y
@@ -77,7 +77,7 @@ static data_unset *configparser_merge_data(data_unset *op1, const data_unset *op
buffer_append_int(&ds->value, ((data_integer*)op2)->value);
return op1;
} else if (op1->type == TYPE_INTEGER && op2->type == TYPE_STRING) {
- data_string *ds = data_string_init();
+ data_string *ds = array_data_string_init();
buffer_append_int(&ds->value, ((data_integer*)op1)->value);
buffer_append_string_buffer(&ds->value, &((data_string*)op2)->value);
op1->fn->free(op1);
@@ -497,7 +497,7 @@ value(A) ::= key(B). {
if (NULL != (env = getenv(B->ptr + 4))) {
data_string *ds;
- ds = data_string_init();
+ ds = array_data_string_init();
buffer_append_string(&ds->value, env);
A = (data_unset *)ds;
}
@@ -515,8 +515,8 @@ value(A) ::= key(B). {
}
value(A) ::= STRING(B). {
- A = (data_unset *)data_string_init();
- /* assumes data_string_init() result does not require swap and buffer_free()*/
+ A = (data_unset *)array_data_string_init();
+ /* assumes array_data_string_init() result does not need swap, buffer_free()*/
memcpy(&((data_string *)A)->value, B, sizeof(*B));
free(B);
B = NULL;
@@ -524,7 +524,7 @@ value(A) ::= STRING(B). {
value(A) ::= INTEGER(B). {
char *endptr;
- A = (data_unset *)data_integer_init();
+ A = (data_unset *)array_data_integer_init();
errno = 0;
((data_integer *)(A))->value = strtol(B->ptr, &endptr, 10);
/* skip trailing whitespace */
@@ -537,8 +537,8 @@ value(A) ::= INTEGER(B). {
B = NULL;
}
value(A) ::= array(B). {
- A = (data_unset *)data_array_init();
- /* assumes data_array_init() result does not require swap and array_free() */
+ A = (data_unset *)array_data_array_init();
+ /* assumes array_data_array_init() result does not need swap, array_free() */
memcpy(&((data_array *)(A))->value, B, sizeof(*B));
free(B);
B = NULL;