Changeset 937 in svn for trunk/utils.h


Ignore:
Timestamp:
2012-06-28T09:38:30Z (3 years ago)
Author:
Xuefer
Message:

still WIP: rewrite sandbox to use callback

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils.h

    r935 r937  
    8080#endif
    8181
    82 /* sandbox */
    83 typedef struct {
    84     ZEND_24(NOTHING, const) char *filename;
    85 
    86     HashTable orig_included_files;
    87     HashTable *tmp_included_files;
    88 
    89 #ifdef HAVE_XCACHE_CONSTANT
    90     HashTable *orig_zend_constants;
    91     HashTable tmp_zend_constants;
    92 #endif
    93     HashTable *orig_function_table;
    94     HashTable *orig_class_table;
    95     HashTable *orig_auto_globals;
    96     HashTable tmp_function_table;
    97     HashTable tmp_class_table;
    98     HashTable tmp_auto_globals;
    99 #ifdef HAVE_XCACHE_CONSTANT
    100     Bucket    *tmp_internal_constant_tail;
    101 #endif
    102     Bucket    *tmp_internal_function_tail;
    103     Bucket    *tmp_internal_class_tail;
    104 
     82/* return op_array to install */
     83typedef zend_op_array *(*xc_sandboxed_func_t)(void *data TSRMLS_DC);
     84zend_op_array *xc_sandbox(xc_sandboxed_func_t sandboxed_func, void *data, ZEND_24(NOTHING, const) char *filename TSRMLS_DC);
     85const Bucket *xc_sandbox_user_function_begin();
     86const Bucket *xc_sandbox_user_class_begin();
     87zend_uint xc_sandbox_compilererror_cnt();
    10588#ifdef XCACHE_ERROR_CACHING
    106     int orig_user_error_handler_error_reporting;
    107     zend_uint compilererror_cnt;
    108     zend_uint compilererror_size;
    109     xc_compilererror_t *compilererrors;
     89xc_compilererror_t *xc_sandbox_compilererrors();
     90zend_uint xc_sandbox_compilererror_cnt();
    11091#endif
    11192
    112 #ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
    113     zend_uint orig_compiler_options;
    114 #endif
    115 } xc_sandbox_t;
    116 
    117 typedef enum _xc_install_action_t {
    118     XC_NoInstall,
    119     XC_Install,
    120     XC_InstallNoBinding
    121 } xc_install_action_t;
    122 
    12393void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce));
    124 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC);
    125 void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC);
    12694
    12795typedef zend_bool (*xc_if_func_t)(void *data);
Note: See TracChangeset for help on using the changeset viewer.