#else
# include "php_config.h"
#endif
+#include "data.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+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);
+ }
}