diff options
author | Peter Kokot <peterkokot@gmail.com> | 2018-10-13 14:12:55 +0200 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2018-10-13 14:12:55 +0200 |
commit | 7f6387b59ae1b5d642b0d05afbb14cab07061a9a (patch) | |
tree | d09f6f4674163b6a57d8805408877b05294f6931 /ext/xml | |
parent | 3f72c77ce47ee0906905b83161d9c1d24e425d89 (diff) | |
download | php-git-7f6387b59ae1b5d642b0d05afbb14cab07061a9a.tar.gz |
Trim trailing whitespace in source code files
Diffstat (limited to 'ext/xml')
-rw-r--r-- | ext/xml/config.m4 | 4 | ||||
-rw-r--r-- | ext/xml/package.xml | 4 | ||||
-rw-r--r-- | ext/xml/php_xml.h | 10 | ||||
-rw-r--r-- | ext/xml/xml.c | 90 |
4 files changed, 54 insertions, 54 deletions
diff --git a/ext/xml/config.m4 b/ext/xml/config.m4 index 715f65a915..0bdaceb0c8 100644 --- a/ext/xml/config.m4 +++ b/ext/xml/config.m4 @@ -15,7 +15,7 @@ PHP_ARG_WITH(libexpat-dir, libexpat install dir, if test "$PHP_XML" != "no"; then - dnl + dnl dnl Default to libxml2 if --with-libexpat-dir is not used. dnl if test "$PHP_LIBEXPAT_DIR" = "no"; then @@ -31,7 +31,7 @@ if test "$PHP_XML" != "no"; then AC_MSG_ERROR([libxml2 not found. Use --with-libxml-dir=<DIR>]) ]) fi - + dnl dnl Check for expat only if --with-libexpat-dir is used. dnl diff --git a/ext/xml/package.xml b/ext/xml/package.xml index ae5e6450d8..cf9d382ce6 100644 --- a/ext/xml/package.xml +++ b/ext/xml/package.xml @@ -24,8 +24,8 @@ </maintainer> </maintainers> <description> -This extension lets you create XML parsers and then define -handlers for different XML events. Each XML parser also has +This extension lets you create XML parsers and then define +handlers for different XML events. Each XML parser also has a few parameters you can adjust. </description> <license>PHP</license> diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h index b44fb87aa9..0930f49423 100644 --- a/ext/xml/php_xml.h +++ b/ext/xml/php_xml.h @@ -34,7 +34,7 @@ extern zend_module_entry xml_module_entry; #define xml_module_ptr NULL #endif -#ifdef HAVE_XML +#ifdef HAVE_XML #include "ext/xml/expat_compat.h" @@ -60,7 +60,7 @@ typedef struct { zval unparsedEntityDeclHandler; zval notationDeclHandler; zval externalEntityRefHandler; - zval unknownEncodingHandler; + zval unknownEncodingHandler; zval startNamespaceDeclHandler; zval endNamespaceDeclHandler; @@ -88,7 +88,7 @@ typedef struct { int lastwasopen; int skipwhite; int isparsing; - + XML_Char *baseURI; } xml_parser; @@ -108,9 +108,9 @@ enum php_xml_option { }; /* for xml_parse_into_struct */ - + #define XML_MAXLEVEL 255 /* XXX this should be dynamic */ - + PHP_FUNCTION(xml_parser_create); PHP_FUNCTION(xml_parser_create_ns); PHP_FUNCTION(xml_set_object); diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 494c347201..b1f8cc5bd9 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -290,7 +290,7 @@ xml_encoding xml_encodings[] = { static XML_Memory_Handling_Suite php_xml_mem_hdlrs; /* True globals, no need for thread safety */ -static int le_xml_parser; +static int le_xml_parser; /* }}} */ @@ -353,7 +353,7 @@ PHP_MINIT_FUNCTION(xml) REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHITE", PHP_XML_OPTION_SKIP_WHITE, CONST_CS|CONST_PERSISTENT); /* this object should not be pre-initialised at compile time, - as the order of members may vary */ + as the order of members may vary */ php_xml_mem_hdlrs.malloc_fcn = php_xml_malloc_wrapper; php_xml_mem_hdlrs.realloc_fcn = php_xml_realloc_wrapper; @@ -401,7 +401,7 @@ static void _xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encodi static void xml_parser_dtor(zend_resource *rsrc) { xml_parser *parser = (xml_parser *)rsrc->ptr; - + if (parser->parser) { XML_ParserFree(parser->parser); } @@ -479,7 +479,7 @@ static void xml_set_handler(zval *handler, zval *data) /* {{{ xml_call_handler() */ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *function_ptr, int argc, zval *argv, zval *retval) { - int i; + int i; ZVAL_UNDEF(retval); if (parser && handler && !EG(exception)) { @@ -508,10 +508,10 @@ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *f Z_TYPE_P(obj) == IS_OBJECT && Z_TYPE_P(method) == IS_STRING) { php_error_docref(NULL, E_WARNING, "Unable to call handler %s::%s()", ZSTR_VAL(Z_OBJCE_P(obj)->name), Z_STRVAL_P(method)); - } else + } else php_error_docref(NULL, E_WARNING, "Unable to call handler"); } - } + } for (i = 0; i < argc; i++) { zval_ptr_dtor(&argv[i]); } @@ -693,10 +693,10 @@ static void _xml_add_to_info(xml_parser *parser,char *name) zval values; array_init(&values); element = zend_hash_str_update(Z_ARRVAL(parser->info), name, strlen(name), &values); - } - + } + add_next_index_long(element, parser->curtag); - + parser->curtag++; } /* }}} */ @@ -747,10 +747,10 @@ void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Ch zend_string_release(att); } - + xml_call_handler(parser, &parser->startElementHandler, parser->startElementPtr, 3, args, &retval); zval_ptr_dtor(&retval); - } + } if (!Z_ISUNDEF(parser->data)) { if (parser->level <= XML_MAXLEVEL) { @@ -820,7 +820,7 @@ void _xml_endElementHandler(void *userData, const XML_Char *name) xml_call_handler(parser, &parser->endElementHandler, parser->endElementPtr, 2, args, &retval); zval_ptr_dtor(&retval); - } + } if (!Z_ISUNDEF(parser->data)) { zval tag; @@ -829,13 +829,13 @@ void _xml_endElementHandler(void *userData, const XML_Char *name) add_assoc_string(parser->ctag, "type", "complete"); } else { array_init(&tag); - + _xml_add_to_info(parser, ZSTR_VAL(tag_name) + parser->toffset); add_assoc_string(&tag, "tag", SKIP_TAGSTART(ZSTR_VAL(tag_name))); /* cast to avoid gcc-warning */ add_assoc_string(&tag, "type", "close"); add_assoc_long(&tag, "level", parser->level); - + zend_hash_next_index_insert(Z_ARRVAL(parser->data), &tag); } @@ -866,7 +866,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len) _xml_xmlchar_zval(s, len, parser->target_encoding, &args[1]); xml_call_handler(parser, &parser->characterDataHandler, parser->characterDataPtr, 2, args, &retval); zval_ptr_dtor(&retval); - } + } if (!Z_ISUNDEF(parser->data)) { size_t i; @@ -891,7 +891,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len) if (doprint || (! parser->skipwhite)) { if (parser->lastwasopen) { zval *myval; - + /* check if the current tag already has a value - if yes append to that! */ if ((myval = zend_hash_str_find(Z_ARRVAL_P(parser->ctag), "value", sizeof("value") - 1))) { int newlen = Z_STRLEN_P(myval) + ZSTR_LEN(decoded_value); @@ -902,7 +902,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len) } else { add_assoc_str(parser->ctag, "value", decoded_value); } - + } else { zval tag; zval *curtag, *mytype, *myval; @@ -980,8 +980,8 @@ void _xml_defaultHandler(void *userData, const XML_Char *s, int len) /* }}} */ /* {{{ _xml_unparsedEntityDeclHandler() */ -void _xml_unparsedEntityDeclHandler(void *userData, - const XML_Char *entityName, +void _xml_unparsedEntityDeclHandler(void *userData, + const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, @@ -1102,9 +1102,9 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp char *ns_param = NULL; size_t ns_param_len = 0; - + XML_Char *encoding; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), (ns_support ? "|ss": "|s"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) { RETURN_FALSE; } @@ -1149,15 +1149,15 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp } /* }}} */ -/* {{{ proto resource xml_parser_create([string encoding]) +/* {{{ proto resource xml_parser_create([string encoding]) Create an XML parser */ PHP_FUNCTION(xml_parser_create) { - php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); + php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ -/* {{{ proto resource xml_parser_create_ns([string encoding [, string sep]]) +/* {{{ proto resource xml_parser_create_ns([string encoding [, string sep]]) Create an XML parser */ PHP_FUNCTION(xml_parser_create_ns) { @@ -1165,7 +1165,7 @@ PHP_FUNCTION(xml_parser_create_ns) } /* }}} */ -/* {{{ proto int xml_set_object(resource parser, object &obj) +/* {{{ proto int xml_set_object(resource parser, object &obj) Set up object which should be used for callbacks */ PHP_FUNCTION(xml_set_object) { @@ -1194,7 +1194,7 @@ PHP_FUNCTION(xml_set_object) } /* }}} */ -/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string ehdl) +/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string ehdl) Set up start and end element handlers */ PHP_FUNCTION(xml_set_element_handler) { @@ -1216,7 +1216,7 @@ PHP_FUNCTION(xml_set_element_handler) } /* }}} */ -/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl) +/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl) Set up character data handler */ PHP_FUNCTION(xml_set_character_data_handler) { @@ -1237,7 +1237,7 @@ PHP_FUNCTION(xml_set_character_data_handler) } /* }}} */ -/* {{{ proto int xml_set_processing_instruction_handler(resource parser, string hdl) +/* {{{ proto int xml_set_processing_instruction_handler(resource parser, string hdl) Set up processing instruction (PI) handler */ PHP_FUNCTION(xml_set_processing_instruction_handler) { @@ -1258,7 +1258,7 @@ PHP_FUNCTION(xml_set_processing_instruction_handler) } /* }}} */ -/* {{{ proto int xml_set_default_handler(resource parser, string hdl) +/* {{{ proto int xml_set_default_handler(resource parser, string hdl) Set up default handler */ PHP_FUNCTION(xml_set_default_handler) { @@ -1279,7 +1279,7 @@ PHP_FUNCTION(xml_set_default_handler) } /* }}} */ -/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string hdl) +/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string hdl) Set up unparsed entity declaration handler */ PHP_FUNCTION(xml_set_unparsed_entity_decl_handler) { @@ -1300,7 +1300,7 @@ PHP_FUNCTION(xml_set_unparsed_entity_decl_handler) } /* }}} */ -/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl) +/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl) Set up notation declaration handler */ PHP_FUNCTION(xml_set_notation_decl_handler) { @@ -1321,7 +1321,7 @@ PHP_FUNCTION(xml_set_notation_decl_handler) } /* }}} */ -/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string hdl) +/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string hdl) Set up external entity reference handler */ PHP_FUNCTION(xml_set_external_entity_ref_handler) { @@ -1342,7 +1342,7 @@ PHP_FUNCTION(xml_set_external_entity_ref_handler) } /* }}} */ -/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string hdl) +/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string hdl) Set up character data handler */ PHP_FUNCTION(xml_set_start_namespace_decl_handler) { @@ -1363,7 +1363,7 @@ PHP_FUNCTION(xml_set_start_namespace_decl_handler) } /* }}} */ -/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string hdl) +/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string hdl) Set up character data handler */ PHP_FUNCTION(xml_set_end_namespace_decl_handler) { @@ -1426,7 +1426,7 @@ PHP_FUNCTION(xml_parse_into_struct) return; } - if (info) { + if (info) { zval_ptr_dtor(info); array_init(info); } @@ -1439,11 +1439,11 @@ PHP_FUNCTION(xml_parse_into_struct) array_init(xdata); ZVAL_COPY_VALUE(&parser->data, xdata); - + if (info) { ZVAL_COPY_VALUE(&parser->info, info); } - + parser->level = 0; parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0); @@ -1458,7 +1458,7 @@ PHP_FUNCTION(xml_parse_into_struct) } /* }}} */ -/* {{{ proto int xml_get_error_code(resource parser) +/* {{{ proto int xml_get_error_code(resource parser) Get XML parser error code */ PHP_FUNCTION(xml_get_error_code) { @@ -1495,7 +1495,7 @@ PHP_FUNCTION(xml_error_string) } /* }}} */ -/* {{{ proto int xml_get_current_line_number(resource parser) +/* {{{ proto int xml_get_current_line_number(resource parser) Get current line number for an XML parser */ PHP_FUNCTION(xml_get_current_line_number) { @@ -1533,7 +1533,7 @@ PHP_FUNCTION(xml_get_current_column_number) } /* }}} */ -/* {{{ proto int xml_get_current_byte_index(resource parser) +/* {{{ proto int xml_get_current_byte_index(resource parser) Get current byte index for an XML parser */ PHP_FUNCTION(xml_get_current_byte_index) { @@ -1552,7 +1552,7 @@ PHP_FUNCTION(xml_get_current_byte_index) } /* }}} */ -/* {{{ proto int xml_parser_free(resource parser) +/* {{{ proto int xml_parser_free(resource parser) Free an XML parser */ PHP_FUNCTION(xml_parser_free) { @@ -1580,7 +1580,7 @@ PHP_FUNCTION(xml_parser_free) } /* }}} */ -/* {{{ proto int xml_parser_set_option(resource parser, int option, mixed value) +/* {{{ proto int xml_parser_set_option(resource parser, int option, mixed value) Set options in an XML parser */ PHP_FUNCTION(xml_parser_set_option) { @@ -1633,7 +1633,7 @@ PHP_FUNCTION(xml_parser_set_option) } /* }}} */ -/* {{{ proto int xml_parser_get_option(resource parser, int option) +/* {{{ proto int xml_parser_get_option(resource parser, int option) Get options from an XML parser */ PHP_FUNCTION(xml_parser_get_option) { @@ -1666,7 +1666,7 @@ PHP_FUNCTION(xml_parser_get_option) } /* }}} */ -/* {{{ proto string utf8_encode(string data) +/* {{{ proto string utf8_encode(string data) Encodes an ISO-8859-1 string to UTF-8 */ PHP_FUNCTION(utf8_encode) { @@ -1686,7 +1686,7 @@ PHP_FUNCTION(utf8_encode) } /* }}} */ -/* {{{ proto string utf8_decode(string data) +/* {{{ proto string utf8_decode(string data) Converts a UTF-8 encoded string to ISO-8859-1 */ PHP_FUNCTION(utf8_decode) { |