123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
- #include "php.h"
- #if HAVE_LIBXML && HAVE_DOM
- #include "php_dom.h"
- const zend_function_entry php_dom_entity_class_functions[] = {
- PHP_FE_END
- };
- int dom_entity_public_id_read(dom_object *obj, zval *retval)
- {
- xmlEntity *nodep = (xmlEntity *) dom_object_get_node(obj);
- if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0);
- return FAILURE;
- }
- if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
- ZVAL_NULL(retval);
- } else {
- ZVAL_STRING(retval, (char *) (nodep->ExternalID));
- }
- return SUCCESS;
- }
- int dom_entity_system_id_read(dom_object *obj, zval *retval)
- {
- xmlEntity *nodep = (xmlEntity *) dom_object_get_node(obj);
- if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0);
- return FAILURE;
- }
- if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
- ZVAL_NULL(retval);
- } else {
- ZVAL_STRING(retval, (char *) (nodep->SystemID));
- }
- return SUCCESS;
- }
- int dom_entity_notation_name_read(dom_object *obj, zval *retval)
- {
- xmlEntity *nodep = (xmlEntity *) dom_object_get_node(obj);
- char *content;
- if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0);
- return FAILURE;
- }
- if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
- ZVAL_NULL(retval);
- } else {
- content = (char *) xmlNodeGetContent((xmlNodePtr) nodep);
- ZVAL_STRING(retval, content);
- xmlFree(content);
- }
- return SUCCESS;
- }
- int dom_entity_actual_encoding_read(dom_object *obj, zval *retval)
- {
- ZVAL_NULL(retval);
- return SUCCESS;
- }
- int dom_entity_actual_encoding_write(dom_object *obj, zval *newval)
- {
- return SUCCESS;
- }
- int dom_entity_encoding_read(dom_object *obj, zval *retval)
- {
- ZVAL_NULL(retval);
- return SUCCESS;
- }
- int dom_entity_encoding_write(dom_object *obj, zval *newval)
- {
- return SUCCESS;
- }
- int dom_entity_version_read(dom_object *obj, zval *retval)
- {
- ZVAL_NULL(retval);
- return SUCCESS;
- }
- int dom_entity_version_write(dom_object *obj, zval *newval)
- {
- return SUCCESS;
- }
- #endif
|