Annotation of embedaddon/php/ext/dom/entity.c, revision 1.1

1.1     ! misho       1: /*
        !             2:    +----------------------------------------------------------------------+
        !             3:    | PHP Version 5                                                        |
        !             4:    +----------------------------------------------------------------------+
        !             5:    | Copyright (c) 1997-2012 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:    +----------------------------------------------------------------------+
        !            18: */
        !            19: 
        !            20: /* $Id: entity.c 321634 2012-01-01 13:15:04Z felipe $ */
        !            21: 
        !            22: #ifdef HAVE_CONFIG_H
        !            23: #include "config.h"
        !            24: #endif
        !            25: 
        !            26: #include "php.h"
        !            27: #if HAVE_LIBXML && HAVE_DOM
        !            28: #include "php_dom.h"
        !            29: 
        !            30: 
        !            31: /*
        !            32: * class DOMEntity extends DOMNode 
        !            33: *
        !            34: * URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-527DCFF2
        !            35: * Since: 
        !            36: */
        !            37: 
        !            38: const zend_function_entry php_dom_entity_class_functions[] = {
        !            39:        PHP_FE_END
        !            40: };
        !            41: 
        !            42: /* {{{ publicId        string  
        !            43: readonly=yes 
        !            44: URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7303025
        !            45: Since: 
        !            46: */
        !            47: int dom_entity_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
        !            48: {
        !            49:        xmlEntity *nodep;
        !            50: 
        !            51:        nodep = (xmlEntity *) dom_object_get_node(obj);
        !            52: 
        !            53:        if (nodep == NULL) {
        !            54:                php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
        !            55:                return FAILURE;
        !            56:        }
        !            57: 
        !            58:        ALLOC_ZVAL(*retval);
        !            59:        if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
        !            60:                ZVAL_NULL(*retval);
        !            61:        } else {
        !            62:                ZVAL_STRING(*retval, (char *) (nodep->ExternalID), 1);
        !            63:        }
        !            64: 
        !            65:        return SUCCESS;
        !            66: }
        !            67: 
        !            68: /* }}} */
        !            69: 
        !            70: /* {{{ systemId        string  
        !            71: readonly=yes 
        !            72: URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7C29F3E
        !            73: Since: 
        !            74: */
        !            75: int dom_entity_system_id_read(dom_object *obj, zval **retval TSRMLS_DC)
        !            76: {
        !            77:        xmlEntity *nodep;
        !            78: 
        !            79:        nodep = (xmlEntity *) dom_object_get_node(obj);
        !            80: 
        !            81:        if (nodep == NULL) {
        !            82:                php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
        !            83:                return FAILURE;
        !            84:        }
        !            85: 
        !            86:        ALLOC_ZVAL(*retval);
        !            87:        if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
        !            88:                ZVAL_NULL(*retval);
        !            89:        } else {
        !            90:                ZVAL_STRING(*retval, (char *) (nodep->SystemID), 1);
        !            91:        }
        !            92: 
        !            93:        return SUCCESS;
        !            94: }
        !            95: 
        !            96: /* }}} */
        !            97: 
        !            98: /* {{{ notationName    string  
        !            99: readonly=yes 
        !           100: URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-6ABAEB38
        !           101: Since: 
        !           102: */
        !           103: int dom_entity_notation_name_read(dom_object *obj, zval **retval TSRMLS_DC)
        !           104: {
        !           105:        xmlEntity *nodep;
        !           106:        char *content;
        !           107: 
        !           108:        nodep = (xmlEntity *) dom_object_get_node(obj);
        !           109: 
        !           110:        if (nodep == NULL) {
        !           111:                php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
        !           112:                return FAILURE;
        !           113:        }
        !           114: 
        !           115:        ALLOC_ZVAL(*retval);
        !           116:        if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
        !           117:                ZVAL_NULL(*retval);
        !           118:        } else {
        !           119:                content = xmlNodeGetContent((xmlNodePtr) nodep);
        !           120:                ZVAL_STRING(*retval, content, 1);
        !           121:                xmlFree(content);
        !           122:        }
        !           123: 
        !           124:        return SUCCESS;
        !           125: }
        !           126: 
        !           127: /* }}} */
        !           128: 
        !           129: /* {{{ actualEncoding  string  
        !           130: readonly=no 
        !           131: URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-actualEncoding
        !           132: Since: DOM Level 3
        !           133: */
        !           134: int dom_entity_actual_encoding_read(dom_object *obj, zval **retval TSRMLS_DC)
        !           135: {
        !           136:        ALLOC_ZVAL(*retval);
        !           137:        ZVAL_NULL(*retval);
        !           138:        return SUCCESS;
        !           139: }
        !           140: 
        !           141: int dom_entity_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
        !           142: {
        !           143:        return SUCCESS;
        !           144: }
        !           145: 
        !           146: /* }}} */
        !           147: 
        !           148: /* {{{ encoding        string  
        !           149: readonly=no 
        !           150: URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-encoding
        !           151: Since: DOM Level 3
        !           152: */
        !           153: int dom_entity_encoding_read(dom_object *obj, zval **retval TSRMLS_DC)
        !           154: {
        !           155:        ALLOC_ZVAL(*retval);
        !           156:        ZVAL_NULL(*retval);
        !           157:        return SUCCESS;
        !           158: }
        !           159: 
        !           160: int dom_entity_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
        !           161: {
        !           162:        return SUCCESS;
        !           163: }
        !           164: 
        !           165: /* }}} */
        !           166: 
        !           167: /* {{{ version string  
        !           168: readonly=no 
        !           169: URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-version
        !           170: Since: DOM Level 3
        !           171: */
        !           172: int dom_entity_version_read(dom_object *obj, zval **retval TSRMLS_DC)
        !           173: {
        !           174:        ALLOC_ZVAL(*retval);
        !           175:        ZVAL_NULL(*retval);
        !           176:        return SUCCESS;
        !           177: }
        !           178: 
        !           179: int dom_entity_version_write(dom_object *obj, zval *newval TSRMLS_DC)
        !           180: {
        !           181:        return SUCCESS;
        !           182: }
        !           183: 
        !           184: /* }}} */
        !           185: 
        !           186: #endif
        !           187: 
        !           188: /*
        !           189:  * Local variables:
        !           190:  * tab-width: 4
        !           191:  * c-basic-offset: 4
        !           192:  * End:
        !           193:  * vim600: noet sw=4 ts=4 fdm=marker
        !           194:  * vim<600: noet sw=4 ts=4
        !           195:  */

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