X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Ftypes%2Fimpl_type.c;h=41baf1c5af87cc1bd2122b4a7cb5f462349f81fc;hb=a0f437f26cd0f121ee911a55327a68a3544bf15f;hp=a5b21889e225d2964109796dc32f84385a8b354c;hpb=2f5af21b263403997e154658635d6b6e6eaab453;p=m6w6%2Fext-psi diff --git a/src/types/impl_type.c b/src/types/impl_type.c index a5b2188..41baf1c 100644 --- a/src/types/impl_type.c +++ b/src/types/impl_type.c @@ -23,26 +23,32 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#else -# include "php_config.h" -#endif +#include "php_psi_stdinc.h" +#include "data.h" -#include -#include -#include +struct psi_impl_type *psi_impl_type_init(token_t type, zend_string *name) +{ + struct psi_impl_type *t = pecalloc(1, sizeof(*t), 1); -#include "impl_type.h" - -impl_type *init_impl_type(token_t type, const char *name) { - impl_type *t = calloc(1, sizeof(*t)); t->type = type; - t->name = strdup(name); + t->name = zend_string_copy(name); + return t; } -void free_impl_type(impl_type *type) { - free(type->name); - free(type); +void psi_impl_type_dump(struct psi_dump *dump, struct psi_impl_type *type) +{ + PSI_DUMP(dump, "%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; + psi_token_free(&type->token); + zend_string_release(type->name); + free(type); + } }