OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
-#include "php_psi_stdinc.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "php_config.h"
+#endif
#include "cpp.h"
#include "data.h"
struct psi_cpp_macro_call *psi_cpp_macro_call_init(zend_string *name,
struct psi_plist *args)
{
- struct psi_cpp_macro_call *call = calloc(1, sizeof(*call));
+ struct psi_cpp_macro_call *call = pecalloc(1, sizeof(*call), 1);
call->name = zend_string_copy(name);
call->args = args;
return call;
struct psi_cpp_macro_call *psi_cpp_macro_call_copy(
struct psi_cpp_macro_call *call)
{
- struct psi_cpp_macro_call *copy = calloc(1, sizeof(*copy));
+ struct psi_cpp_macro_call *copy = pecalloc(1, sizeof(*copy), 1);
copy->name = zend_string_copy(call->name);
if (call->token) {
copy->token = psi_token_copy(call->token);
}
if (call->args) {
copy->args = psi_plist_copy(call->args,
- (void (*)(void*)) psi_token_copy_ctor);
+ (void (*)(void*)) psi_num_exp_copy_ctor);
}
return copy;
}
}
}
-void psi_cpp_macro_call_dump(int fd, struct psi_cpp_macro_call *call)
+void psi_cpp_macro_call_dump(struct psi_dump *dump, struct psi_cpp_macro_call *call)
{
size_t i = 0;
struct psi_num_exp *num;
- dprintf(fd, "%s(", call->name->val);
+ PSI_DUMP(dump, "%s(", call->name->val);
while (psi_plist_get(call->args, i++, &num)) {
if (i > 1) {
- dprintf(fd, ", ");
+ PSI_DUMP(dump, ", ");
}
- psi_num_exp_dump(fd, num);
+ psi_num_exp_dump(dump, num);
}
- dprintf(fd, ")");
+ PSI_DUMP(dump, ")");
}