File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / xml / php_xml.h
Revision 1.1.1.4 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Sun Jun 15 20:04:00 2014 UTC (10 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29, HEAD
php 5.4.29

    1: /*
    2:    +----------------------------------------------------------------------+
    3:    | PHP Version 5                                                        |
    4:    +----------------------------------------------------------------------+
    5:    | Copyright (c) 1997-2014 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: Stig Sæther Bakken <ssb@php.net>                            |
   16:    |          Thies C. Arntzen <thies@thieso.net>                         |
   17:    |          Sterling Hughes <sterling@php.net>                          |
   18:    +----------------------------------------------------------------------+
   19: */
   20: 
   21: /* $Id: php_xml.h,v 1.1.1.4 2014/06/15 20:04:00 misho Exp $ */
   22: 
   23: #ifndef PHP_XML_H
   24: #define PHP_XML_H
   25: 
   26: #ifdef HAVE_XML
   27: extern zend_module_entry xml_module_entry;
   28: #define xml_module_ptr &xml_module_entry
   29: #else
   30: #define xml_module_ptr NULL
   31: #endif
   32: 
   33: #ifdef HAVE_XML 
   34: 
   35: #include "ext/xml/expat_compat.h"
   36: 
   37: 
   38: #ifdef XML_UNICODE
   39: #error "UTF-16 Unicode support not implemented!"
   40: #endif
   41: 
   42: ZEND_BEGIN_MODULE_GLOBALS(xml)
   43: 	XML_Char *default_encoding;
   44: ZEND_END_MODULE_GLOBALS(xml)
   45: 
   46: typedef struct {
   47: 	int index;
   48: 	int case_folding;
   49: 	XML_Parser parser;
   50: 	XML_Char *target_encoding;
   51: 
   52: 	zval *startElementHandler;
   53: 	zval *endElementHandler;
   54: 	zval *characterDataHandler;
   55: 	zval *processingInstructionHandler;
   56: 	zval *defaultHandler;
   57: 	zval *unparsedEntityDeclHandler;
   58: 	zval *notationDeclHandler;
   59: 	zval *externalEntityRefHandler;
   60: 	zval *unknownEncodingHandler;	
   61: 	zval *startNamespaceDeclHandler;
   62: 	zval *endNamespaceDeclHandler;
   63: 
   64: 	zend_function *startElementPtr;
   65: 	zend_function *endElementPtr;
   66: 	zend_function *characterDataPtr;
   67: 	zend_function *processingInstructionPtr;
   68: 	zend_function *defaultPtr;
   69: 	zend_function *unparsedEntityDeclPtr;
   70: 	zend_function *notationDeclPtr;
   71: 	zend_function *externalEntityRefPtr;
   72: 	zend_function *unknownEncodingPtr;
   73: 	zend_function *startNamespaceDeclPtr;
   74: 	zend_function *endNamespaceDeclPtr;
   75: 
   76: 	zval *object;
   77: 
   78: 	zval *data;
   79: 	zval *info;
   80: 	int level;
   81: 	int toffset;
   82: 	int curtag;
   83: 	zval **ctag;
   84: 	char **ltags;
   85: 	int lastwasopen;
   86: 	int skipwhite;
   87: 	int isparsing;
   88: 	
   89: 	XML_Char *baseURI;
   90: } xml_parser;
   91: 
   92: 
   93: typedef struct {
   94: 	XML_Char *name;
   95: 	char (*decoding_function)(unsigned short);
   96: 	unsigned short (*encoding_function)(unsigned char);
   97: } xml_encoding;
   98: 
   99: 
  100: enum php_xml_option {
  101:     PHP_XML_OPTION_CASE_FOLDING = 1,
  102:     PHP_XML_OPTION_TARGET_ENCODING,
  103:     PHP_XML_OPTION_SKIP_TAGSTART,
  104:     PHP_XML_OPTION_SKIP_WHITE
  105: };
  106: 
  107: /* for xml_parse_into_struct */
  108: 	
  109: #define XML_MAXLEVEL 255 /* XXX this should be dynamic */
  110: 	
  111: PHP_FUNCTION(xml_parser_create);
  112: PHP_FUNCTION(xml_parser_create_ns);
  113: PHP_FUNCTION(xml_set_object);
  114: PHP_FUNCTION(xml_set_element_handler);
  115: PHP_FUNCTION(xml_set_character_data_handler);
  116: PHP_FUNCTION(xml_set_processing_instruction_handler);
  117: PHP_FUNCTION(xml_set_default_handler);
  118: PHP_FUNCTION(xml_set_unparsed_entity_decl_handler);
  119: PHP_FUNCTION(xml_set_notation_decl_handler);
  120: PHP_FUNCTION(xml_set_external_entity_ref_handler);
  121: PHP_FUNCTION(xml_set_start_namespace_decl_handler);
  122: PHP_FUNCTION(xml_set_end_namespace_decl_handler);
  123: PHP_FUNCTION(xml_parse);
  124: PHP_FUNCTION(xml_get_error_code);
  125: PHP_FUNCTION(xml_error_string);
  126: PHP_FUNCTION(xml_get_current_line_number);
  127: PHP_FUNCTION(xml_get_current_column_number);
  128: PHP_FUNCTION(xml_get_current_byte_index);
  129: PHP_FUNCTION(xml_parser_free);
  130: PHP_FUNCTION(xml_parser_set_option);
  131: PHP_FUNCTION(xml_parser_get_option);
  132: PHP_FUNCTION(utf8_encode);
  133: PHP_FUNCTION(utf8_decode);
  134: PHP_FUNCTION(xml_parse_into_struct);
  135: 
  136: PHPAPI char *_xml_zval_strdup(zval *val);
  137: PHPAPI char *xml_utf8_decode(const XML_Char *, int, int *, const XML_Char *);
  138: PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding);
  139: 
  140: #endif /* HAVE_LIBEXPAT */
  141: 
  142: #define phpext_xml_ptr xml_module_ptr
  143: 
  144: #ifdef ZTS
  145: #define XML(v) TSRMG(xml_globals_id, zend_xml_globals *, v)
  146: #else
  147: #define XML(v) (xml_globals.v)
  148: #endif
  149: 
  150: #endif /* PHP_XML_H */
  151: 
  152: /*
  153:  * Local variables:
  154:  * tab-width: 4
  155:  * c-basic-offset: 4
  156:  * End:
  157:  */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>