php-src/ext/xml/php_xml.h

158 lines
4.4 KiB
C
Raw Normal View History

/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
2014-01-03 03:08:10 +00:00
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
2006-01-01 12:51:34 +00:00
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
2006-01-01 12:51:34 +00:00
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
2003-03-18 12:06:09 +00:00
| Authors: Stig S<EFBFBD>ther Bakken <ssb@php.net> |
2000-10-29 09:14:55 +00:00
| Thies C. Arntzen <thies@thieso.net> |
| Sterling Hughes <sterling@php.net> |
+----------------------------------------------------------------------+
*/
1999-05-22 16:12:09 +00:00
/* $Id$ */
#ifndef PHP_XML_H
#define PHP_XML_H
#ifdef HAVE_XML
extern zend_module_entry xml_module_entry;
#define xml_module_ptr &xml_module_entry
#else
#define xml_module_ptr NULL
#endif
#ifdef HAVE_XML
1999-07-21 14:43:12 +00:00
#include "ext/xml/expat_compat.h"
1999-09-20 12:51:20 +00:00
#ifdef XML_UNICODE
#error "UTF-16 Unicode support not implemented!"
#endif
ZEND_BEGIN_MODULE_GLOBALS(xml)
XML_Char *default_encoding;
ZEND_END_MODULE_GLOBALS(xml)
typedef struct {
int case_folding;
XML_Parser parser;
XML_Char *target_encoding;
2014-05-03 07:58:09 +00:00
zval index;
zval startElementHandler;
zval endElementHandler;
zval characterDataHandler;
zval processingInstructionHandler;
zval defaultHandler;
zval unparsedEntityDeclHandler;
zval notationDeclHandler;
zval externalEntityRefHandler;
zval unknownEncodingHandler;
zval startNamespaceDeclHandler;
zval endNamespaceDeclHandler;
zend_function *startElementPtr;
zend_function *endElementPtr;
zend_function *characterDataPtr;
zend_function *processingInstructionPtr;
zend_function *defaultPtr;
zend_function *unparsedEntityDeclPtr;
zend_function *notationDeclPtr;
zend_function *externalEntityRefPtr;
zend_function *unknownEncodingPtr;
zend_function *startNamespaceDeclPtr;
zend_function *endNamespaceDeclPtr;
2014-05-03 07:58:09 +00:00
zval object;
2014-05-03 07:58:09 +00:00
zval data;
zval info;
1999-05-22 16:12:09 +00:00
int level;
int toffset;
int curtag;
2014-05-03 07:58:09 +00:00
zval *ctag;
1999-05-22 16:12:09 +00:00
char **ltags;
int lastwasopen;
int skipwhite;
int isparsing;
1999-05-22 16:12:09 +00:00
XML_Char *baseURI;
} xml_parser;
typedef struct {
XML_Char *name;
char (*decoding_function)(unsigned short);
1999-05-22 16:12:09 +00:00
unsigned short (*encoding_function)(unsigned char);
} xml_encoding;
1999-12-18 03:20:53 +00:00
enum php_xml_option {
PHP_XML_OPTION_CASE_FOLDING = 1,
PHP_XML_OPTION_TARGET_ENCODING,
PHP_XML_OPTION_SKIP_TAGSTART,
PHP_XML_OPTION_SKIP_WHITE
};
1999-05-22 16:12:09 +00:00
/* 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);
PHP_FUNCTION(xml_set_element_handler);
PHP_FUNCTION(xml_set_character_data_handler);
PHP_FUNCTION(xml_set_processing_instruction_handler);
PHP_FUNCTION(xml_set_default_handler);
PHP_FUNCTION(xml_set_unparsed_entity_decl_handler);
PHP_FUNCTION(xml_set_notation_decl_handler);
PHP_FUNCTION(xml_set_external_entity_ref_handler);
PHP_FUNCTION(xml_set_start_namespace_decl_handler);
PHP_FUNCTION(xml_set_end_namespace_decl_handler);
PHP_FUNCTION(xml_parse);
PHP_FUNCTION(xml_get_error_code);
PHP_FUNCTION(xml_error_string);
PHP_FUNCTION(xml_get_current_line_number);
PHP_FUNCTION(xml_get_current_column_number);
PHP_FUNCTION(xml_get_current_byte_index);
PHP_FUNCTION(xml_parser_free);
PHP_FUNCTION(xml_parser_set_option);
PHP_FUNCTION(xml_parser_get_option);
PHP_FUNCTION(utf8_encode);
PHP_FUNCTION(utf8_decode);
1999-05-22 16:12:09 +00:00
PHP_FUNCTION(xml_parse_into_struct);
2014-05-03 07:58:09 +00:00
PHPAPI char *_xml_zval_strdup(zval *);
PHPAPI zend_string *xml_utf8_decode(const XML_Char *, size_t, const XML_Char *);
PHPAPI zend_string *xml_utf8_encode(const char *, size_t, const XML_Char *);
1999-12-05 14:16:37 +00:00
#endif /* HAVE_LIBEXPAT */
#define phpext_xml_ptr xml_module_ptr
1999-09-20 12:51:20 +00:00
#ifdef ZTS
#define XML(v) TSRMG(xml_globals_id, zend_xml_globals *, v)
1999-09-20 12:51:20 +00:00
#else
#define XML(v) (xml_globals.v)
#endif
#endif /* PHP_XML_H */
1999-07-21 14:43:12 +00:00
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/