Permalink
Browse files

- Two new API calls for Derick (retreive CV name and value) by Dmitry

  • Loading branch information...
1 parent eba6a36 commit 8838c0f860feed8acf116b726f2dfbcc432a87d1 @andigutmans andigutmans committed Jan 22, 2005
Showing with 17 additions and 0 deletions.
  1. +8 −0 Zend/zend_compile.c
  2. +2 −0 Zend/zend_compile.h
  3. +5 −0 Zend/zend_execute.c
  4. +2 −0 Zend/zend_execute.h
View
@@ -3864,6 +3864,14 @@ int zend_get_class_fetch_type(char *class_name, uint class_name_len)
}
}
+ZEND_API char* zend_get_compiled_variable_name(zend_op_array *op_array, zend_uint var, int* name_len)
+{
+ if (name_len) {
+ *name_len = op_array->vars[var].name_len;
+ }
+ return op_array->vars[var].name;
+}
+
/*
* Local variables:
* tab-width: 4
View
@@ -319,6 +319,8 @@ ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TS
ZEND_API char *zend_get_compiled_filename(TSRMLS_D);
ZEND_API int zend_get_compiled_lineno(TSRMLS_D);
+ZEND_API char* zend_get_compiled_variable_name(zend_op_array *op_array, zend_uint var, int* name_len);
+
#ifdef ZTS
const char *zend_get_zendtext(TSRMLS_D);
int zend_get_zendleng(TSRMLS_D);
View
@@ -144,6 +144,11 @@ static inline void zend_pzval_unlock_free_func(zval *z)
#define CV_OF(i) (EG(current_execute_data)->CVs[i])
#define CV_DEF_OF(i) (EG(active_op_array)->vars[i])
+ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data_ptr, zend_uint var)
+{
+ return execute_data_ptr->CVs[var];
+}
+
static inline void zend_get_cv_address(zend_compiled_variable *cv, zval ***ptr, temp_variable *Ts TSRMLS_DC)
{
zval *new_zval = &EG(uninitialized_zval);
View
@@ -174,6 +174,8 @@ void zend_shutdown_timeout_thread();
*/
#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && (zval)->type == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
+ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data_ptr, zend_uint var);
+
END_EXTERN_C()
#endif /* ZEND_EXECUTE_H */

0 comments on commit 8838c0f

Please sign in to comment.