X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Ftypes%2Fimpl_type.c;h=3517727a249b38f179e06d54d5990553b6a51c58;hb=2fa436074ca9a5e87f39b696de832fa2188fcfc6;hp=f865bd899dac3129cff4f50a847c9d39bab29e27;hpb=9bcb1df0786a8193d65949c857baaba2f4296e84;p=m6w6%2Fext-psi diff --git a/src/types/impl_type.c b/src/types/impl_type.c index f865bd8..3517727 100644 --- a/src/types/impl_type.c +++ b/src/types/impl_type.c @@ -26,26 +26,29 @@ #include "php_psi_stdinc.h" #include "data.h" -struct psi_impl_type *psi_impl_type_init(token_t type, const char *name) +struct psi_impl_type *psi_impl_type_init(token_t type, zend_string *name) { struct psi_impl_type *t = calloc(1, sizeof(*t)); t->type = type; - t->name = strdup(name); + t->name = zend_string_copy(name); return t; } +void psi_impl_type_dump(int fd, struct psi_impl_type *type) +{ + dprintf(fd, "%s", type->name->val); +} + void psi_impl_type_free(struct psi_impl_type **type_ptr) { if (*type_ptr) { struct psi_impl_type *type = *type_ptr; *type_ptr = NULL; - if (type->token) { - free(type->token); - } - free(type->name); + psi_token_free(&type->token); + zend_string_release(type->name); free(type); } }