X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fcontext.c;h=da36c8ef6b13693cbbdb7931889433f5b8872e0a;hp=46210f0659e2ce991cac079319e49d0f8001b894;hb=b0fdc1f1b8ae5ec4d3f47741b523fa6a60ae32bb;hpb=682b684daaa140de059da4a060098b8a6c0a439e diff --git a/src/context.c b/src/context.c index 46210f0..da36c8e 100644 --- a/src/context.c +++ b/src/context.c @@ -142,7 +142,7 @@ void psi_context_build(struct psi_context *C, const char *paths) psi_parser_parse(&P, I); psi_context_add(C, &P); psi_parser_dtor(&P); - free(I); + psi_parser_input_free(&I); } } @@ -176,11 +176,11 @@ zend_function_entry *psi_context_compile(struct psi_context *C) while (psi_plist_get(C->consts, i++, &c)) { - if (zend_get_constant_str(c->name, strlen(c->name))) { + if (zend_get_constant(c->name)) { continue; } - zc.name = zend_string_init(c->name, strlen(c->name), 1); + zc.name = zend_string_copy(c->name); switch (c->type->type) { case PSI_T_BOOL: @@ -218,9 +218,9 @@ zend_function_entry *psi_context_compile(struct psi_context *C) zend_string *name; if (psi_decl_type_is_anon(e->name, "enum")) { - name = strpprintf(0, "psi\\%s", item->name); + name = strpprintf(0, "psi\\%s", item->name->val); } else { - name = strpprintf(0, "psi\\%s\\%s", e->name, item->name); + name = strpprintf(0, "psi\\%s\\%s", e->name->val, item->name->val); } if (zend_get_constant(name)) { @@ -324,7 +324,6 @@ void psi_context_free(struct psi_context **C) void psi_context_dump(struct psi_context *C, int fd) { size_t i; - struct psi_data *D; dprintf(fd, "// psi.engine=%s\n// %lu files\n", (char *) C->ops->query(C, PSI_CONTEXT_QUERY_SELF, NULL),