X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=php5-swig%2Fxml-template.swig;h=2feceba72843fada4f12226cfd7acf6ff36361cf;hb=2cb15f2dccf0c8966ac064389146b0e84a1cfa07;hp=fa9e7aa81d4bf0fbb6ee4b358c885549657025f7;hpb=015976d7d24ac1ae6deb474b9d70e5703f54f449;p=xml-template diff --git a/php5-swig/xml-template.swig b/php5-swig/xml-template.swig index fa9e7aa..2feceba 100644 --- a/php5-swig/xml-template.swig +++ b/php5-swig/xml-template.swig @@ -58,6 +58,8 @@ Directive* convert_php_objects_to_directive(zval *obj) char *str = Z_STRVAL_P(obj); return new Replace(str); } + case IS_NULL: + return NULL; default: printf("WARNING: Unknown type %d!\n", Z_TYPE_P(obj)); break; @@ -66,12 +68,19 @@ Directive* convert_php_objects_to_directive(zval *obj) return NULL; } +xmlDocPtr XML_Template_process_file(const char *input_filename, Directive *root_directive, bool clean) +{ + xmlDocPtr ret = process_file(input_filename, root_directive, clean); + delete root_directive; + return ret; +} + %} %typemap(in) Directive* { $1 = convert_php_objects_to_directive(*$input); } -xmlDocPtr process_file(const char *input_filename, Directive *root_directive, bool clean); +xmlDocPtr XML_Template_process_file(const char *input_filename, Directive *root_directive, bool clean); void output_to_fd_and_free(xmlDocPtr doc, int fd);