diff options
Diffstat (limited to 'ext/dom/document.c')
-rw-r--r-- | ext/dom/document.c | 77 |
1 files changed, 30 insertions, 47 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c index 1bd244c9ae..25f2b91317 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -224,7 +224,7 @@ ZEND_END_ARG_INFO(); * Since: */ -const zend_function_entry php_dom_document_class_functions[] = { +const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */ PHP_FALIAS(createElement, dom_document_create_element, arginfo_dom_document_create_element) PHP_FALIAS(createDocumentFragment, dom_document_create_document_fragment, arginfo_dom_document_create_document_fragment) PHP_FALIAS(createTextNode, dom_document_create_text_node, arginfo_dom_document_create_text_node) @@ -264,6 +264,7 @@ const zend_function_entry php_dom_document_class_functions[] = { PHP_ME(domdocument, registerNodeClass, arginfo_dom_document_registernodeclass, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; +/* }}} */ /* {{{ docType DOMDocumentType readonly=yes @@ -299,8 +300,6 @@ int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC) /* }}} */ - - /* {{{ implementation DOMImplementation readonly=yes URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA @@ -315,8 +314,6 @@ int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC) /* }}} */ - - /* {{{ documentElement DOMElement readonly=yes URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092 @@ -421,8 +418,6 @@ int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC) /* }}} */ - - /* {{{ standalone boolean readonly=no URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone @@ -487,8 +482,6 @@ int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC) /* }}} */ - - /* {{{ version string readonly=no URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version @@ -683,7 +676,6 @@ int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC } /* }}} */ - /* {{{ resolveExternals boolean readonly=no */ @@ -726,7 +718,6 @@ int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC } /* }}} */ - /* {{{ preserveWhiteSpace boolean readonly=no */ @@ -811,7 +802,6 @@ int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC) } /* }}} */ - /* {{{ substituteEntities boolean readonly=no */ @@ -854,7 +844,6 @@ int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_D } /* }}} */ - /* {{{ documentURI string readonly=no URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI @@ -919,8 +908,6 @@ int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC) /* }}} */ - - /* {{{ config DOMConfiguration readonly=yes URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config @@ -935,8 +922,6 @@ int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC) /* }}} */ - - /* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547 Since: @@ -970,7 +955,6 @@ PHP_FUNCTION(dom_document_create_element) } /* }}} end dom_document_create_element */ - /* {{{ proto DOMDocumentFragment dom_document_create_document_fragment(); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5 Since: @@ -998,7 +982,6 @@ PHP_FUNCTION(dom_document_create_document_fragment) } /* }}} end dom_document_create_document_fragment */ - /* {{{ proto DOMText dom_document_create_text_node(string data); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127 Since: @@ -1027,7 +1010,6 @@ PHP_FUNCTION(dom_document_create_text_node) } /* }}} end dom_document_create_text_node */ - /* {{{ proto DOMComment dom_document_create_comment(string data); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328 Since: @@ -1056,7 +1038,6 @@ PHP_FUNCTION(dom_document_create_comment) } /* }}} end dom_document_create_comment */ - /* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8 Since: @@ -1085,7 +1066,6 @@ PHP_FUNCTION(dom_document_create_cdatasection) } /* }}} end dom_document_create_cdatasection */ - /* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439 Since: @@ -1121,7 +1101,6 @@ PHP_FUNCTION(dom_document_create_processing_instruction) } /* }}} end dom_document_create_processing_instruction */ - /* {{{ proto DOMAttr dom_document_create_attribute(string name); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198 Since: @@ -1156,7 +1135,6 @@ PHP_FUNCTION(dom_document_create_attribute) } /* }}} end dom_document_create_attribute */ - /* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE Since: @@ -1190,7 +1168,6 @@ PHP_FUNCTION(dom_document_create_entity_reference) } /* }}} end dom_document_create_entity_reference */ - /* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094 Since: @@ -1217,7 +1194,6 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name) } /* }}} end dom_document_get_elements_by_tag_name */ - /* {{{ proto DOMNode dom_document_import_node(DOMNode importedNode, boolean deep); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Core-Document-importNode Since: DOM Level 2 @@ -1260,7 +1236,6 @@ PHP_FUNCTION(dom_document_import_node) } /* }}} end dom_document_import_node */ - /* {{{ proto DOMElement dom_document_create_element_ns(string namespaceURI, string qualifiedName [,string value]); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrElNS Since: DOM Level 2 @@ -1324,7 +1299,6 @@ PHP_FUNCTION(dom_document_create_element_ns) } /* }}} end dom_document_create_element_ns */ - /* {{{ proto DOMAttr dom_document_create_attribute_ns(string namespaceURI, string qualifiedName); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrAttrNS Since: DOM Level 2 @@ -1390,7 +1364,6 @@ PHP_FUNCTION(dom_document_create_attribute_ns) } /* }}} end dom_document_create_attribute_ns */ - /* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name_ns(string namespaceURI, string localName); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBTNNS Since: DOM Level 2 @@ -1418,7 +1391,6 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns) } /* }}} end dom_document_get_elements_by_tag_name_ns */ - /* {{{ proto DOMElement dom_document_get_element_by_id(string elementId); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBId Since: DOM Level 2 @@ -1449,7 +1421,6 @@ PHP_FUNCTION(dom_document_get_element_by_id) } /* }}} end dom_document_get_element_by_id */ - /* {{{ proto DOMNode dom_document_adopt_node(DOMNode source); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-adoptNode Since: DOM Level 3 @@ -1460,7 +1431,6 @@ PHP_FUNCTION(dom_document_adopt_node) } /* }}} end dom_document_adopt_node */ - /* {{{ proto void dom_document_normalize_document(); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-normalizeDocument Since: DOM Level 3 @@ -1481,7 +1451,6 @@ PHP_FUNCTION(dom_document_normalize_document) } /* }}} end dom_document_normalize_document */ - /* {{{ proto DOMNode dom_document_rename_node(node n, string namespaceURI, string qualifiedName); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-renameNode Since: DOM Level 3 @@ -1539,7 +1508,8 @@ PHP_METHOD(domdocument, __construct) } /* }}} end DOMDocument::__construct */ -char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) { +char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) /* {{{ */ +{ xmlURI *uri; xmlChar *escsource; char *file_dest; @@ -1584,10 +1554,10 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p return file_dest; } +/* }}} */ - -/* {{{ */ -static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int options TSRMLS_DC) { +static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int options TSRMLS_DC) /* {{{ */ +{ xmlDocPtr ret; xmlParserCtxtPtr ctxt = NULL; dom_doc_propsptr doc_props; @@ -1895,7 +1865,8 @@ PHP_FUNCTION(dom_document_savexml) } /* }}} end dom_document_savexml */ -static xmlNodePtr php_dom_free_xinclude_node(xmlNodePtr cur TSRMLS_DC) { +static xmlNodePtr php_dom_free_xinclude_node(xmlNodePtr cur TSRMLS_DC) /* {{{ */ +{ xmlNodePtr xincnode; xincnode = cur; @@ -1905,8 +1876,10 @@ static xmlNodePtr php_dom_free_xinclude_node(xmlNodePtr cur TSRMLS_DC) { return cur; } +/* }}} */ -static void php_dom_remove_xinclude_nodes(xmlNodePtr cur TSRMLS_DC) { +static void php_dom_remove_xinclude_nodes(xmlNodePtr cur TSRMLS_DC) /* {{{ */ +{ while(cur) { if (cur->type == XML_XINCLUDE_START) { cur = php_dom_free_xinclude_node(cur TSRMLS_CC); @@ -1931,6 +1904,7 @@ static void php_dom_remove_xinclude_nodes(xmlNodePtr cur TSRMLS_DC) { } } } +/* }}} */ /* {{{ proto int dom_document_xinclude([int options]) Substitutues xincludes in a DomDocument */ @@ -1970,7 +1944,7 @@ PHP_FUNCTION(dom_document_xinclude) } } - +/* }}} */ /* {{{ proto boolean dom_document_validate(); Since: DOM extended @@ -2007,11 +1981,10 @@ PHP_FUNCTION(dom_document_validate) xmlFreeValidCtxt(cvp); } - +/* }}} */ #if defined(LIBXML_SCHEMAS_ENABLED) -static void -_dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) +static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ { zval *id; xmlDoc *docp; @@ -2084,6 +2057,7 @@ _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) RETURN_FALSE; } } +/* }}} */ /* {{{ proto boolean dom_document_schema_validate_file(string filename); */ PHP_FUNCTION(dom_document_schema_validate_file) @@ -2099,9 +2073,7 @@ PHP_FUNCTION(dom_document_schema_validate_xml) } /* }}} end dom_document_schema_validate */ - -static void -_dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type) +static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ { zval *id; xmlDoc *docp; @@ -2174,6 +2146,7 @@ _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type) RETURN_FALSE; } } +/* }}} */ /* {{{ proto boolean dom_document_relaxNG_validate_file(string filename); */ PHP_FUNCTION(dom_document_relaxNG_validate_file) @@ -2193,7 +2166,7 @@ PHP_FUNCTION(dom_document_relaxNG_validate_xml) #if defined(LIBXML_HTML_ENABLED) -static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) +static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ { zval *id, *rv = NULL; xmlDoc *docp = NULL, *newdoc; @@ -2266,6 +2239,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) DOM_RET_OBJ(rv, (xmlNodePtr) newdoc, &ret, NULL); } } +/* }}} */ /* {{{ proto DOMNode dom_document_load_html_file(string source); Since: DOM extended @@ -2405,3 +2379,12 @@ PHP_METHOD(domdocument, registerNodeClass) /* }}} */ #endif /* HAVE_LIBXML && HAVE_DOM */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ |