84b9d9a3a2
In HHVM (and HPHPc before it) we've been piggybacking resources on the KindOfObject machinery. At the language level, resource is considered to be a different type than object, and there are a number of differences in behavior between objects and resources (ex. resources don't allow for dynamic properties, resources don't work with the clone operator, the "(object)" cast behaves differently for resources vs. objects, etc). Piggybacking resources on the KindOfObject machinery has some downsides. Code that deals with KindOfObject values often needs to check if the value is a resource and go down a different code path. This makes things harder to maintain and harder to keep parity with Zend. Also, these extra branches hurt performance a little, and they make it harder for the JIT to do a good job in some cases when its generating machine code that operates on objects. This diff prepares the code base for a new KindOfResource type by adding a new "Resource" smart pointer type (currently a typedef for the Object smart pointer type) and it updates the C++ code and the idl files appropriately. This diff is essentially a cosmetic change and should not impact run time behavior. In the next diff (part 2) we'll actually add a new KindOfResource type, detach ResourceData from the ObjectData inheritence hierarchy, and provide a real implementation for the Resource smart pointer type (instead of just aliasing the Object smart pointer type).
57 linhas
3.0 KiB
C++
57 linhas
3.0 KiB
C++
/*
|
|
+----------------------------------------------------------------------+
|
|
| HipHop for PHP |
|
|
+----------------------------------------------------------------------+
|
|
| Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) |
|
|
| Copyright (c) 1997-2010 The PHP Group |
|
|
+----------------------------------------------------------------------+
|
|
| 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: |
|
|
| 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. |
|
|
+----------------------------------------------------------------------+
|
|
*/
|
|
|
|
#ifndef incl_HPHP_EXT_XML_H_
|
|
#define incl_HPHP_EXT_XML_H_
|
|
|
|
// >>>>>> Generated by idl.php. Do NOT modify. <<<<<<
|
|
|
|
#include "hphp/runtime/base/base_includes.h"
|
|
|
|
namespace HPHP {
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
Object f_xml_parser_create(CStrRef encoding = null_string);
|
|
bool f_xml_parser_free(CResRef parser);
|
|
int64_t f_xml_parse(CResRef parser, CStrRef data, bool is_final = true);
|
|
int64_t f_xml_parse_into_struct(CResRef parser, CStrRef data, VRefParam values, VRefParam index = uninit_null());
|
|
Object f_xml_parser_create_ns(CStrRef encoding = null_string, CStrRef separator = null_string);
|
|
Variant f_xml_parser_get_option(CResRef parser, int option);
|
|
bool f_xml_parser_set_option(CResRef parser, int option, CVarRef value);
|
|
bool f_xml_set_character_data_handler(CResRef parser, CVarRef handler);
|
|
bool f_xml_set_default_handler(CResRef parser, CVarRef handler);
|
|
bool f_xml_set_element_handler(CResRef parser, CVarRef start_element_handler, CVarRef end_element_handler);
|
|
bool f_xml_set_processing_instruction_handler(CResRef parser, CVarRef handler);
|
|
bool f_xml_set_start_namespace_decl_handler(CResRef parser, CVarRef handler);
|
|
bool f_xml_set_end_namespace_decl_handler(CResRef parser, CVarRef handler);
|
|
bool f_xml_set_unparsed_entity_decl_handler(CResRef parser, CVarRef handler);
|
|
bool f_xml_set_external_entity_ref_handler(CResRef parser, CVarRef handler);
|
|
bool f_xml_set_notation_decl_handler(CResRef parser, CVarRef handler);
|
|
bool f_xml_set_object(CResRef parser, VRefParam object);
|
|
int64_t f_xml_get_current_byte_index(CResRef parser);
|
|
int64_t f_xml_get_current_column_number(CResRef parser);
|
|
int64_t f_xml_get_current_line_number(CResRef parser);
|
|
int64_t f_xml_get_error_code(CResRef parser);
|
|
String f_xml_error_string(int code);
|
|
String f_utf8_decode(CStrRef data);
|
|
String f_utf8_encode(CStrRef data);
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
}
|
|
|
|
#endif // incl_HPHP_EXT_XML_H_
|