summaryrefslogtreecommitdiff
path: root/ext/simplexml
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-11-30 13:15:59 +0000
committerAntony Dovgal <tony2001@php.net>2007-11-30 13:15:59 +0000
commitf5b1ee4b2b85e9cd363e1615bd267bc4cab3bdb8 (patch)
tree3232269631d6b48ef5d1970c9260dd4e4eda11d3 /ext/simplexml
parent2ac81c2e6e29e868de4bb2f7636e4353e966696c (diff)
downloadphp-git-f5b1ee4b2b85e9cd363e1615bd267bc4cab3bdb8.tar.gz
MFH: fix folding
Diffstat (limited to 'ext/simplexml')
-rw-r--r--ext/simplexml/simplexml.c95
1 files changed, 58 insertions, 37 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index e1fac8a0a0..93e3ecf93c 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -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 zend_object_value php_sxe_register_object(php_sxe_object * TSRMLS_DC);
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 void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE
} \
}
-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 @@ static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node TS
return node;
}
}
+/* }}} */
static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name, int prefix) /* {{{ */
{
@@ -975,7 +984,7 @@ static void sxe_dimension_delete(zval *object, zval *offset TSRMLS_DC)
}
/* }}} */
-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 @@ static inline char * sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, in
return res;
}
+/* }}} */
/* {{{ _get_base_node_value()
*/
@@ -1017,7 +1027,7 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
}
/* }}} */
-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 @@ static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval *val
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 @@ SXE_METHOD(asXML)
#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 int sxe_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zval *sxe_get_value(zval *z TSRMLS_DC)
+static zval *sxe_get_value(zval *z TSRMLS_DC) /* {{{ */
{
zval *retval;
@@ -1816,9 +1826,9 @@ static zval *sxe_get_value(zval *z TSRMLS_DC)
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 @@ static zend_object_handlers sxe_object_handlers = {
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 @@ static zend_object_handlers sxe_ze1_object_handlers = {
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 @@ PHP_FUNCTION(simplexml_load_string)
}
/* }}} */
-
/* {{{ 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 @@ SXE_METHOD(__construct)
}
/* }}} */
-
-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 @@ zend_object_iterator_funcs php_sxe_iterator_funcs = {
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 @@ next_iter:
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 @@ static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data TSRML
}
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 @@ zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, i
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 @@ static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC)
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 @@ static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_k
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 @@ ZEND_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC)
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 @@ static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC)
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 @@ void *simplexml_export_node(zval *object TSRMLS_DC)
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 @@ PHP_FUNCTION(simplexml_import_dom)
}
/* }}} */
-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 @@ zend_module_entry simplexml_module_entry = {
"0.1",
STANDARD_MODULE_PROPERTIES
};
+/* }}} */
#ifdef COMPILE_DL_SIMPLEXML
ZEND_GET_MODULE(simplexml)
@@ -2408,7 +2427,7 @@ ZEND_GET_MODULE(simplexml)
/* 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 @@ static const zend_function_entry sxe_functions[] = {
SXE_ME(addAttribute, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
+/* }}} */
/* {{{ PHP_MINIT_FUNCTION(simplexml)
*/
@@ -2467,6 +2487,7 @@ PHP_MSHUTDOWN_FUNCTION(simplexml)
return SUCCESS;
}
/* }}} */
+
/* {{{ PHP_MINFO_FUNCTION(simplexml)
*/
PHP_MINFO_FUNCTION(simplexml)