tony2001 Fri Nov 30 13:16:00 2007 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/simplexml simplexml.c
Log:
MFH: fix folding
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.35.2.4&r2=1.151.2.22.2.35.2.5&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.4
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.5
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.4 Mon Nov 12
18:58:48 2007
+++ php-src/ext/simplexml/simplexml.c Fri Nov 30 13:15:59 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: simplexml.c,v 1.151.2.22.2.35.2.4 2007/11/12 18:58:48 rrichards Exp $
*/
+/* $Id: simplexml.c,v 1.151.2.22.2.35.2.5 2007/11/30 13:15:59 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -42,10 +42,11 @@
zend_class_entry *sxe_class_entry = NULL;
-ZEND_API zend_class_entry *sxe_get_element_class_entry()
+ZEND_API zend_class_entry *sxe_get_element_class_entry() /* {{{ */
{
return sxe_class_entry;
}
+/* }}} */
#define SXE_ME(func, arg_info, flags) PHP_ME(simplexml_element, func,
arg_info, flags)
#define SXE_MALIAS(func, alias, arg_info, flags) PHP_MALIAS(simplexml_element,
func, alias, arg_info, flags)
@@ -57,6 +58,12 @@
static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data
TSRMLS_DC);
static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node,
int use_data TSRMLS_DC);
static zval *sxe_get_value(zval *z TSRMLS_DC);
+static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
+static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC);
+static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval
***data TSRMLS_DC);
+static int php_sxe_iterator_current_key(zend_object_iterator *iter, char
**str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+static void php_sxe_iterator_move_forward(zend_object_iterator *iter
TSRMLS_DC);
+static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC);
/* {{{ _node_as_zval()
*/
@@ -103,7 +110,8 @@
} \
}
-static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node
TSRMLS_DC) {
+static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node
TSRMLS_DC) /* {{{ */
+{
php_sxe_object *intern;
xmlNodePtr retnode = NULL;
@@ -118,6 +126,7 @@
return node;
}
}
+/* }}} */
static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar
*name, int prefix) /* {{{ */
{
@@ -975,7 +984,7 @@
}
/* }}} */
-static inline char * sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list,
int inLine)
+static inline char * sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list,
int inLine) /* {{{ */
{
xmlChar *tmp = xmlNodeListGetString(doc, list, inLine);
char *res = estrdup((char*)tmp);
@@ -984,6 +993,7 @@
return res;
}
+/* }}} */
/* {{{ _get_base_node_value()
*/
@@ -1017,7 +1027,7 @@
}
/* }}} */
-static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval
*value TSRMLS_DC)
+static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval
*value TSRMLS_DC) /* {{{ */
{
zval **data_ptr;
zval *newptr;
@@ -1040,9 +1050,8 @@
zend_hash_quick_update(rv, name, namelen, h, &value,
sizeof(zval *), NULL);
}
}
+/* }}} */
-/* {{{ sxe_get_prop_hash()
- */
static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /*
{{{ */
{
zval *value;
@@ -1373,13 +1382,14 @@
#define SXE_NS_PREFIX(ns) (ns->prefix ? (char*)ns->prefix : "")
-static inline void sxe_add_namespace_name(zval *return_value, xmlNsPtr ns)
+static inline void sxe_add_namespace_name(zval *return_value, xmlNsPtr ns) /*
{{{ */
{
char *prefix = SXE_NS_PREFIX(ns);
if (zend_hash_exists(Z_ARRVAL_P(return_value), prefix, strlen(prefix) +
1) == 0) {
add_assoc_string(return_value, prefix, (char*)ns->href, 1);
}
}
+/* }}} */
static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool
recursive, zval *return_value TSRMLS_DC) /* {{{ */
{
@@ -1802,7 +1812,7 @@
}
/* }}} */
-static zval *sxe_get_value(zval *z TSRMLS_DC)
+static zval *sxe_get_value(zval *z TSRMLS_DC) /* {{{ */
{
zval *retval;
@@ -1816,9 +1826,9 @@
Z_SET_REFCOUNT_P(retval, 0);
return retval;
}
+/* }}} */
-
-static zend_object_handlers sxe_object_handlers = {
+static zend_object_handlers sxe_object_handlers = { /* {{{ */
ZEND_OBJECTS_STORE_HANDLERS,
sxe_property_read,
sxe_property_write,
@@ -1842,8 +1852,9 @@
sxe_count_elements,
sxe_get_debug_info
};
+/* }}} */
-static zend_object_handlers sxe_ze1_object_handlers = {
+static zend_object_handlers sxe_ze1_object_handlers = { /* {{{ */
ZEND_OBJECTS_STORE_HANDLERS,
sxe_property_read,
sxe_property_write,
@@ -1867,14 +1878,16 @@
sxe_count_elements,
sxe_get_debug_info
};
+/* }}} */
-static zend_object_value sxe_object_ze1_clone(zval *zobject TSRMLS_DC)
+static zend_object_value sxe_object_ze1_clone(zval *zobject TSRMLS_DC) /* {{{
*/
{
php_error(E_ERROR, "Cannot clone object of class %s due to
'zend.ze1_compatibility_mode'", Z_OBJCE_P(zobject)->name);
/* Return zobject->value.obj just to satisfy compiler */
/* FIXME: Should not be a fatal */
return zobject->value.obj;
}
+/* }}} */
/* {{{ sxe_object_clone()
*/
@@ -2111,7 +2124,6 @@
}
/* }}} */
-
/* {{{ proto SimpleXMLElement::__construct(string data [, int options [, bool
data_is_url [, string ns [, bool is_prefix]]]])
SimpleXMLElement constructor */
SXE_METHOD(__construct)
@@ -2146,15 +2158,7 @@
}
/* }}} */
-
-static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
-static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC);
-static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval
***data TSRMLS_DC);
-static int php_sxe_iterator_current_key(zend_object_iterator *iter, char
**str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
-static void php_sxe_iterator_move_forward(zend_object_iterator *iter
TSRMLS_DC);
-static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC);
-
-zend_object_iterator_funcs php_sxe_iterator_funcs = {
+zend_object_iterator_funcs php_sxe_iterator_funcs = { /* {{{ */
php_sxe_iterator_dtor,
php_sxe_iterator_valid,
php_sxe_iterator_current_data,
@@ -2162,8 +2166,9 @@
php_sxe_iterator_move_forward,
php_sxe_iterator_rewind,
};
+/* }}} */
-static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node,
int use_data TSRMLS_DC)
+static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node,
int use_data TSRMLS_DC) /* {{{ */
{
xmlChar *prefix = sxe->iter.nsprefix;
int isprefix = sxe->iter.isprefix;
@@ -2192,8 +2197,9 @@
return node;
}
+/* }}} */
-static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data
TSRMLS_DC)
+static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data
TSRMLS_DC) /* {{{ */
{
xmlNodePtr node;
@@ -2218,8 +2224,9 @@
}
return NULL;
}
+/* }}} */
-zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object,
int by_ref TSRMLS_DC)
+zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object,
int by_ref TSRMLS_DC) /* {{{ */
{
php_sxe_iterator *iterator;
@@ -2235,8 +2242,9 @@
return (zend_object_iterator*)iterator;
}
+/* }}} */
-static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{
*/
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
@@ -2247,22 +2255,25 @@
efree(iterator);
}
+/* }}} */
-static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC)
+static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{
*/
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
return iterator->sxe->iter.data ? SUCCESS : FAILURE;
}
+/* }}} */
-static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval
***data TSRMLS_DC)
+static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval
***data TSRMLS_DC) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
*data = &iterator->sxe->iter.data;
}
+/* }}} */
-static int php_sxe_iterator_current_key(zend_object_iterator *iter, char
**str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
+static int php_sxe_iterator_current_key(zend_object_iterator *iter, char
**str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
{
zval *curobj;
xmlNodePtr curnode = NULL;
@@ -2286,8 +2297,9 @@
return HASH_KEY_IS_STRING;
}
+/* }}} */
-ZEND_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC)
+ZEND_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC) /*
{{{ */
{
xmlNodePtr node = NULL;
php_sxe_object *intern;
@@ -2303,14 +2315,16 @@
php_sxe_iterator_fetch(sxe, node->next, 1 TSRMLS_CC);
}
}
+/* }}} */
-static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void php_sxe_iterator_move_forward(zend_object_iterator *iter
TSRMLS_DC) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
php_sxe_move_forward_iterator(iterator->sxe TSRMLS_CC);
}
+/* }}} */
-static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC) /*
{{{ */
{
php_sxe_object *sxe;
@@ -2319,8 +2333,9 @@
php_sxe_reset_iterator(sxe, 1 TSRMLS_CC);
}
+/* }}} */
-void *simplexml_export_node(zval *object TSRMLS_DC)
+void *simplexml_export_node(zval *object TSRMLS_DC) /* {{{ */
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -2329,6 +2344,7 @@
GET_NODE(sxe, node);
return php_sxe_get_first_node(sxe, node TSRMLS_CC);
}
+/* }}} */
/* {{{ proto simplemxml_element simplexml_import_dom(domNode node [, string
class_name])
Get a simplexml_element object from dom to allow for processing */
@@ -2376,19 +2392,21 @@
}
/* }}} */
-const zend_function_entry simplexml_functions[] = {
+const zend_function_entry simplexml_functions[] = { /* {{{ */
PHP_FE(simplexml_load_file, NULL)
PHP_FE(simplexml_load_string, NULL)
PHP_FE(simplexml_import_dom, NULL)
{NULL, NULL, NULL}
};
+/* }}} */
-static const zend_module_dep simplexml_deps[] = {
+static const zend_module_dep simplexml_deps[] = { /* {{{ */
ZEND_MOD_REQUIRED("libxml")
{NULL, NULL, NULL}
};
+/* }}} */
-zend_module_entry simplexml_module_entry = {
+zend_module_entry simplexml_module_entry = { /* {{{ */
STANDARD_MODULE_HEADER_EX, NULL,
simplexml_deps,
"SimpleXML",
@@ -2401,6 +2419,7 @@
"0.1",
STANDARD_MODULE_PROPERTIES
};
+/* }}} */
#ifdef COMPILE_DL_SIMPLEXML
ZEND_GET_MODULE(simplexml)
@@ -2408,7 +2427,7 @@
/* the method table */
/* each method can have its own parameters and visibility */
-static const zend_function_entry sxe_functions[] = {
+static const zend_function_entry sxe_functions[] = { /* {{{ */
SXE_ME(__construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) /*
must be called */
SXE_ME(asXML, NULL, ZEND_ACC_PUBLIC)
SXE_MALIAS(saveXML, asXML, NULL, ZEND_ACC_PUBLIC)
@@ -2423,6 +2442,7 @@
SXE_ME(addAttribute, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
+/* }}} */
/* {{{ PHP_MINIT_FUNCTION(simplexml)
*/
@@ -2467,13 +2487,14 @@
return SUCCESS;
}
/* }}} */
+
/* {{{ PHP_MINFO_FUNCTION(simplexml)
*/
PHP_MINFO_FUNCTION(simplexml)
{
php_info_print_table_start();
php_info_print_table_header(2, "Simplexml support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.35.2.4
$");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.35.2.5
$");
php_info_print_table_row(2, "Schema support",
#ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php