diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-13 16:28:55 +0200 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-14 11:49:02 +0200 |
commit | c5fb4f0794c6efe06f64d6d462e14357d527b564 (patch) | |
tree | c34c643b8505356beaa091904a8e8aa9d9cd4519 /ext/xmlreader/php_xmlreader.c | |
parent | 80598f12507c5cbde04163289e4d2575f05d2a0c (diff) | |
download | php-git-c5fb4f0794c6efe06f64d6d462e14357d527b564.tar.gz |
Generate function entries from stubs for a couple of extensions
Migrates ext/standard, ext/tidy, ext/tokenizer,
ext/xml, ext/xml_reader, and ext/xml_writer. Closes GH-5381.
Diffstat (limited to 'ext/xmlreader/php_xmlreader.c')
-rw-r--r-- | ext/xmlreader/php_xmlreader.c | 88 |
1 files changed, 28 insertions, 60 deletions
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 8ba87763c1..acb39a7fc9 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -23,13 +23,13 @@ #include "php_ini.h" #include "ext/standard/info.h" #include "php_xmlreader.h" +#include "php_xmlreader_arginfo.h" #ifdef HAVE_DOM #include "ext/dom/xml_common.h" #include "ext/dom/dom_ce.h" #endif #include <libxml/xmlreader.h> #include <libxml/uri.h> -#include "xmlreader_arginfo.h" zend_class_entry *xmlreader_class_entry; @@ -523,7 +523,7 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t /* {{{ proto bool XMLReader::close() Closes xmlreader - current frees resources until xmlTextReaderClose is fixed in libxml */ -PHP_METHOD(xmlreader, close) +PHP_METHOD(XMLReader, close) { zval *id; xmlreader_object *intern; @@ -545,7 +545,7 @@ PHP_METHOD(xmlreader, close) /* {{{ proto string XMLReader::getAttribute(string name) Get value of an attribute from current element */ -PHP_METHOD(xmlreader, getAttribute) +PHP_METHOD(XMLReader, getAttribute) { php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderGetAttribute); } @@ -553,7 +553,7 @@ PHP_METHOD(xmlreader, getAttribute) /* {{{ proto string XMLReader::getAttributeNo(int index) Get value of an attribute at index from current element */ -PHP_METHOD(xmlreader, getAttributeNo) +PHP_METHOD(XMLReader, getAttributeNo) { zval *id; zend_long attr_pos; @@ -579,7 +579,7 @@ PHP_METHOD(xmlreader, getAttributeNo) /* {{{ proto string XMLReader::getAttributeNs(string name, string namespaceURI) Get value of a attribute via name and namespace from current element */ -PHP_METHOD(xmlreader, getAttributeNs) +PHP_METHOD(XMLReader, getAttributeNs) { zval *id; size_t name_len = 0, ns_uri_len = 0; @@ -610,7 +610,7 @@ PHP_METHOD(xmlreader, getAttributeNs) /* {{{ proto bool XMLReader::getParserProperty(int property) Indicates whether given property (one of the parser option constants) is set or not on parser */ -PHP_METHOD(xmlreader, getParserProperty) +PHP_METHOD(XMLReader, getParserProperty) { zval *id; zend_long property; @@ -640,7 +640,7 @@ PHP_METHOD(xmlreader, getParserProperty) Returns boolean indicating if parsed document is valid or not. Must set XMLREADER_LOADDTD or XMLREADER_VALIDATE parser option prior to the first call to read or this method will always return FALSE */ -PHP_METHOD(xmlreader, isValid) +PHP_METHOD(XMLReader, isValid) { php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderIsValid); } @@ -648,7 +648,7 @@ PHP_METHOD(xmlreader, isValid) /* {{{ proto string XMLReader::lookupNamespace(string prefix) Return namespaceURI for associated prefix on current node */ -PHP_METHOD(xmlreader, lookupNamespace) +PHP_METHOD(XMLReader, lookupNamespace) { php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderLookupNamespace); } @@ -656,7 +656,7 @@ PHP_METHOD(xmlreader, lookupNamespace) /* {{{ proto bool XMLReader::moveToAttribute(string name) Positions reader at specified attribute - Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttribute) +PHP_METHOD(XMLReader, moveToAttribute) { zval *id; size_t name_len = 0; @@ -690,7 +690,7 @@ PHP_METHOD(xmlreader, moveToAttribute) /* {{{ proto bool XMLReader::moveToAttributeNo(int index) Positions reader at attribute at specified index. Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttributeNo) +PHP_METHOD(XMLReader, moveToAttributeNo) { zval *id; zend_long attr_pos; @@ -718,7 +718,7 @@ PHP_METHOD(xmlreader, moveToAttributeNo) /* {{{ proto bool XMLReader::moveToAttributeNs(string name, string namespaceURI) Positions reader at attribute spcified by name and namespaceURI. Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttributeNs) +PHP_METHOD(XMLReader, moveToAttributeNs) { zval *id; size_t name_len=0, ns_uri_len=0; @@ -751,7 +751,7 @@ PHP_METHOD(xmlreader, moveToAttributeNs) /* {{{ proto bool XMLReader::moveToElement() Moves the position of the current instance to the node that contains the current Attribute node. */ -PHP_METHOD(xmlreader, moveToElement) +PHP_METHOD(XMLReader, moveToElement) { php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToElement); } @@ -759,7 +759,7 @@ PHP_METHOD(xmlreader, moveToElement) /* {{{ proto bool XMLReader::moveToFirstAttribute() Moves the position of the current instance to the first attribute associated with the current node. */ -PHP_METHOD(xmlreader, moveToFirstAttribute) +PHP_METHOD(XMLReader, moveToFirstAttribute) { php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToFirstAttribute); } @@ -767,7 +767,7 @@ PHP_METHOD(xmlreader, moveToFirstAttribute) /* {{{ proto bool XMLReader::moveToNextAttribute() Moves the position of the current instance to the next attribute associated with the current node. */ -PHP_METHOD(xmlreader, moveToNextAttribute) +PHP_METHOD(XMLReader, moveToNextAttribute) { php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToNextAttribute); } @@ -775,7 +775,7 @@ PHP_METHOD(xmlreader, moveToNextAttribute) /* {{{ proto bool XMLReader::read() Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, read) +PHP_METHOD(XMLReader, read) { zval *id; int retval; @@ -803,7 +803,7 @@ PHP_METHOD(xmlreader, read) /* {{{ proto bool XMLReader::next([string localname]) Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, next) +PHP_METHOD(XMLReader, next) { zval *id; int retval; @@ -839,7 +839,7 @@ PHP_METHOD(xmlreader, next) /* {{{ proto bool XMLReader::open(string URI [, string encoding [, int options]]) Sets the URI that the XMLReader will parse. */ -PHP_METHOD(xmlreader, open) +PHP_METHOD(XMLReader, open) { zval *id; size_t source_len = 0, encoding_len = 0; @@ -895,7 +895,7 @@ PHP_METHOD(xmlreader, open) /* }}} */ /* Not Yet Implemented in libxml - functions exist just not coded -PHP_METHOD(xmlreader, resetState) +PHP_METHOD(XMLReader, resetState) { } @@ -903,7 +903,7 @@ PHP_METHOD(xmlreader, resetState) /* {{{ proto string XMLReader::readInnerXml() Reads the contents of the current node, including child nodes and markup. */ -PHP_METHOD(xmlreader, readInnerXml) +PHP_METHOD(XMLReader, readInnerXml) { php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadInnerXml); } @@ -911,7 +911,7 @@ PHP_METHOD(xmlreader, readInnerXml) /* {{{ proto bool XMLReader::readOuterXml() Reads the contents of the current node, including child nodes and markup. */ -PHP_METHOD(xmlreader, readOuterXml) +PHP_METHOD(XMLReader, readOuterXml) { php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadOuterXml); } @@ -919,7 +919,7 @@ PHP_METHOD(xmlreader, readOuterXml) /* {{{ proto bool XMLReader::readString() Reads the contents of an element or a text node as a string. */ -PHP_METHOD(xmlreader, readString) +PHP_METHOD(XMLReader, readString) { php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadString); } @@ -927,7 +927,7 @@ PHP_METHOD(xmlreader, readString) /* {{{ proto bool XMLReader::setSchema(string filename) Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). */ -PHP_METHOD(xmlreader, setSchema) +PHP_METHOD(XMLReader, setSchema) { #ifdef LIBXML_SCHEMAS_ENABLED zval *id; @@ -970,7 +970,7 @@ PHP_METHOD(xmlreader, setSchema) /* {{{ proto bool XMLReader::setParserProperty(int property, bool value) Sets parser property (one of the parser option constants). Properties must be set after open() or XML() and before the first read() is called */ -PHP_METHOD(xmlreader, setParserProperty) +PHP_METHOD(XMLReader, setParserProperty) { zval *id; zend_long property; @@ -999,7 +999,7 @@ PHP_METHOD(xmlreader, setParserProperty) /* {{{ proto bool XMLReader::setRelaxNGSchema(string filename) Sets the string that the XMLReader will parse. */ -PHP_METHOD(xmlreader, setRelaxNGSchema) +PHP_METHOD(XMLReader, setRelaxNGSchema) { php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_FILE); } @@ -1007,7 +1007,7 @@ PHP_METHOD(xmlreader, setRelaxNGSchema) /* {{{ proto bool XMLReader::setRelaxNGSchemaSource(string source) Sets the string that the XMLReader will parse. */ -PHP_METHOD(xmlreader, setRelaxNGSchemaSource) +PHP_METHOD(XMLReader, setRelaxNGSchemaSource) { php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_STRING); } @@ -1021,7 +1021,7 @@ XMLPUBFUN int XMLCALL /* {{{ proto bool XMLReader::XML(string source [, string encoding [, int options]]) Sets the string that the XMLReader will parse. */ -PHP_METHOD(xmlreader, XML) +PHP_METHOD(XMLReader, XML) { zval *id; size_t source_len = 0, encoding_len = 0; @@ -1105,7 +1105,7 @@ PHP_METHOD(xmlreader, XML) /* {{{ proto bool XMLReader::expand() Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, expand) +PHP_METHOD(XMLReader, expand) { #ifdef HAVE_DOM zval *id, *basenode = NULL; @@ -1153,38 +1153,6 @@ PHP_METHOD(xmlreader, expand) } /* }}} */ -static const zend_function_entry xmlreader_functions[] /* {{{ */ = { - PHP_ME(xmlreader, close, arginfo_class_XMLReader_close, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttribute, arginfo_class_XMLReader_getAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttributeNo, arginfo_class_XMLReader_getAttributeNo, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttributeNs, arginfo_class_XMLReader_getAttributeNs, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getParserProperty, arginfo_class_XMLReader_getParserProperty, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, isValid, arginfo_class_XMLReader_isValid, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, lookupNamespace, arginfo_class_XMLReader_lookupNamespace, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttributeNo, arginfo_class_XMLReader_moveToAttributeNo, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttribute, arginfo_class_XMLReader_moveToAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttributeNs, arginfo_class_XMLReader_moveToAttributeNs, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToElement, arginfo_class_XMLReader_moveToElement, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToFirstAttribute, arginfo_class_XMLReader_moveToFirstAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToNextAttribute, arginfo_class_XMLReader_moveToNextAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, open, arginfo_class_XMLReader_open, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(xmlreader, read, arginfo_class_XMLReader_read, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, next, arginfo_class_XMLReader_next, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readInnerXml, arginfo_class_XMLReader_readInnerXml, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readOuterXml, arginfo_class_XMLReader_readOuterXml, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readString, arginfo_class_XMLReader_readString, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setSchema, arginfo_class_XMLReader_setSchema, ZEND_ACC_PUBLIC) -/* Not Yet Implemented though defined in libxml as of 2.6.9dev - PHP_ME(xmlreader, resetState, NULL, ZEND_ACC_PUBLIC) -*/ - PHP_ME(xmlreader, setParserProperty, arginfo_class_XMLReader_setParserProperty, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setRelaxNGSchema, arginfo_class_XMLReader_setRelaxNGSchema, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setRelaxNGSchemaSource, arginfo_class_XMLReader_setRelaxNGSchemaSource, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, XML, arginfo_class_XMLReader_XML, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(xmlreader, expand, arginfo_class_XMLReader_expand, ZEND_ACC_PUBLIC) - PHP_FE_END -}; /* }}} */ - /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(xmlreader) @@ -1202,7 +1170,7 @@ PHP_MINIT_FUNCTION(xmlreader) xmlreader_object_handlers.get_method = xmlreader_get_method; xmlreader_object_handlers.clone_obj = NULL; - INIT_CLASS_ENTRY(ce, "XMLReader", xmlreader_functions); + INIT_CLASS_ENTRY(ce, "XMLReader", class_XMLReader_methods); ce.create_object = xmlreader_objects_new; xmlreader_class_entry = zend_register_internal_class(&ce); |