+ ZEND_HASH_FOREACH_END();
+
+ zend_hash_destroy(&psi_cpp_defaults);
+
+ return SUCCESS;
+}
+
+static void free_cpp_def(zval *p)
+{
+ if (Z_TYPE_P(p) == IS_PTR) {
+ struct psi_cpp_macro_decl *macro = Z_PTR_P(p);
+
+ if (!zend_hash_exists(&psi_cpp_defaults, macro->token->text)) {
+ psi_cpp_macro_decl_free(¯o);
+ }
+ }
+}
+
+struct psi_cpp *psi_cpp_init(struct psi_parser *P)
+{
+ struct psi_cpp *cpp = pecalloc(1, sizeof(*cpp), 1);
+
+ cpp->parser = P;
+ zend_hash_init(&cpp->once, 0, NULL, NULL, 1);
+ zend_hash_init(&cpp->defs, 0, NULL, free_cpp_def, 1);
+ zend_hash_copy(&cpp->defs, &psi_cpp_defaults, NULL);
+ zend_hash_init(&cpp->expanding, 0, NULL, NULL, 1);
+
+ return cpp;