PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/dom - php_dom.h (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 2 2 100.0 %
Date: 2019-05-06 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | PHP Version 7                                                        |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) The PHP Group                                          |
       6             :    +----------------------------------------------------------------------+
       7             :    | This source file is subject to version 3.01 of the PHP license,      |
       8             :    | that is bundled with this package in the file LICENSE, and is        |
       9             :    | available through the world-wide-web at the following url:           |
      10             :    | http://www.php.net/license/3_01.txt                                  |
      11             :    | If you did not receive a copy of the PHP license and are unable to   |
      12             :    | obtain it through the world-wide-web, please send a note to          |
      13             :    | license@php.net so we can mail you a copy immediately.               |
      14             :    +----------------------------------------------------------------------+
      15             :    | Authors: Christian Stocker <chregu@php.net>                          |
      16             :    |          Rob Richards <rrichards@php.net>                                                      |
      17             :    |          Marcus Borger <helly@php.net>                               |
      18             :    +----------------------------------------------------------------------+
      19             : */
      20             : 
      21             : #ifndef PHP_DOM_H
      22             : #define PHP_DOM_H
      23             : 
      24             : extern zend_module_entry dom_module_entry;
      25             : #define phpext_dom_ptr &dom_module_entry
      26             : 
      27             : #ifdef ZTS
      28             : #include "TSRM.h"
      29             : #endif
      30             : 
      31             : #include <libxml/parser.h>
      32             : #include <libxml/parserInternals.h>
      33             : #include <libxml/tree.h>
      34             : #include <libxml/uri.h>
      35             : #include <libxml/xmlerror.h>
      36             : #include <libxml/xinclude.h>
      37             : #include <libxml/hash.h>
      38             : #include <libxml/c14n.h>
      39             : #if defined(LIBXML_HTML_ENABLED)
      40             : #include <libxml/HTMLparser.h>
      41             : #include <libxml/HTMLtree.h>
      42             : #endif
      43             : #if defined(LIBXML_XPATH_ENABLED)
      44             : #include <libxml/xpath.h>
      45             : #include <libxml/xpathInternals.h>
      46             : #endif
      47             : #if defined(LIBXML_XPTR_ENABLED)
      48             : #include <libxml/xpointer.h>
      49             : #endif
      50             : #ifdef PHP_WIN32
      51             : #ifndef DOM_EXPORTS
      52             : #define DOM_EXPORTS
      53             : #endif
      54             : #endif
      55             : 
      56             : #include "xml_common.h"
      57             : #include "ext/libxml/php_libxml.h"
      58             : #include "zend_exceptions.h"
      59             : #include "dom_ce.h"
      60             : /* DOM API_VERSION, please bump it up, if you change anything in the API
      61             :     therefore it's easier for the script-programmers to check, what's working how
      62             :    Can be checked with phpversion("dom");
      63             : */
      64             : #define DOM_API_VERSION "20031129"
      65             : /* Define a custom type for iterating using an unused nodetype */
      66             : #define DOM_NODESET XML_XINCLUDE_START
      67             : 
      68             : typedef struct _dom_xpath_object {
      69             :         int registerPhpFunctions;
      70             :         HashTable *registered_phpfunctions;
      71             :         HashTable *node_list;
      72             :         dom_object dom;
      73             : } dom_xpath_object;
      74             : 
      75          99 : static inline dom_xpath_object *php_xpath_obj_from_obj(zend_object *obj) {
      76          99 :         return (dom_xpath_object*)((char*)(obj)
      77             :                 - XtOffsetOf(dom_xpath_object, dom) - XtOffsetOf(dom_object, std));
      78             : }
      79             : 
      80             : #define Z_XPATHOBJ_P(zv)  php_xpath_obj_from_obj(Z_OBJ_P((zv)))
      81             : 
      82             : typedef struct _dom_nnodemap_object {
      83             :         dom_object *baseobj;
      84             :         zval baseobj_zv;
      85             :         int nodetype;
      86             :         xmlHashTable *ht;
      87             :         xmlChar *local;
      88             :         xmlChar *ns;
      89             : } dom_nnodemap_object;
      90             : 
      91             : typedef struct {
      92             :         zend_object_iterator intern;
      93             :         zval curobj;
      94             :         HashPosition pos;
      95             : } php_dom_iterator;
      96             : 
      97             : #include "dom_fe.h"
      98             : 
      99             : dom_object *dom_object_get_data(xmlNodePtr obj);
     100             : dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document);
     101             : zend_object *dom_objects_new(zend_class_entry *class_type);
     102             : zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type);
     103             : #if defined(LIBXML_XPATH_ENABLED)
     104             : zend_object *dom_xpath_objects_new(zend_class_entry *class_type);
     105             : #endif
     106             : int dom_get_strict_error(php_libxml_ref_obj *document);
     107             : void php_dom_throw_error(int error_code, int strict_error);
     108             : void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error);
     109             : void node_list_unlink(xmlNodePtr node);
     110             : int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len);
     111             : xmlNsPtr dom_get_ns(xmlNodePtr node, char *uri, int *errorcode, char *prefix);
     112             : void dom_set_old_ns(xmlDoc *doc, xmlNs *ns);
     113             : xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName);
     114             : void dom_normalize (xmlNodePtr nodep);
     115             : xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *local, int *cur, int index);
     116             : void php_dom_create_implementation(zval *retval);
     117             : int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child);
     118             : int dom_has_feature(char *feature, char *version);
     119             : int dom_node_is_read_only(xmlNodePtr node);
     120             : int dom_node_children_valid(xmlNodePtr node);
     121             : void php_dom_create_interator(zval *return_value, int ce_type);
     122             : void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns);
     123             : xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID);
     124             : xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index);
     125             : xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index);
     126             : zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
     127             : void dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce);
     128             : 
     129             : #define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \
     130             : INIT_CLASS_ENTRY(ce, name, funcs); \
     131             : ce.create_object = dom_objects_new; \
     132             : entry = zend_register_internal_class_ex(&ce, parent_ce);
     133             : 
     134             : #define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \
     135             :         __intern = Z_DOMOBJ_P(__id); \
     136             :         if (__intern->ptr == NULL || !(__ptr = (__prtype)((php_libxml_node_ptr *)__intern->ptr)->node)) { \
     137             :                 php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", ZSTR_VAL(__intern->std.ce->name));\
     138             :                 RETURN_NULL();\
     139             :         } \
     140             : }
     141             : 
     142             : #define DOM_NO_ARGS() \
     143             :         if (zend_parse_parameters_none() == FAILURE) { \
     144             :                 return; \
     145             :         }
     146             : 
     147             : #define DOM_NOT_IMPLEMENTED() \
     148             :         php_error_docref(NULL, E_WARNING, "Not yet implemented"); \
     149             :         return;
     150             : 
     151             : #define DOM_NODELIST 0
     152             : #define DOM_NAMEDNODEMAP 1
     153             : 
     154             : PHP_MINIT_FUNCTION(dom);
     155             : PHP_MSHUTDOWN_FUNCTION(dom);
     156             : PHP_MINFO_FUNCTION(dom);
     157             : 
     158             : #endif /* PHP_DOM_H */

Generated by: LCOV version 1.10

Generated at Mon, 06 May 2019 17:58:13 +0000 (998 days ago)

Copyright © 2005-2022 The PHP Group
All rights reserved.