typedef struct _zend_function_entry {
const char *fname;
- void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
+ zif_handler handler;
const struct _zend_internal_arg_info *arg_info;
uint32_t num_args;
uint32_t flags;
zend_function func;
zval this_ptr;
zend_class_entry *called_scope;
- void (*orig_internal_handler)(INTERNAL_FUNCTION_PARAMETERS);
+ zif_handler orig_internal_handler;
} zend_closure;
/* non-static since it needs to be referenced */
}
/* }}} */
-static void zend_closure_call_magic(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ {
+static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ {
zend_fcall_info fci;
zend_fcall_info_cache fcc;
zval params[2];
}
/* }}} */
-static void zend_closure_internal_handler(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
+static ZEND_NAMED_FUNCTION(zend_closure_internal_handler) /* {{{ */
{
zend_closure *closure = (zend_closure*)EX(func)->common.prototype;
closure->orig_internal_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
#define ZEND_RETURN_VALUE 0
#define ZEND_RETURN_REFERENCE 1
+/* zend_internal_function_handler */
+typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
+
typedef struct _zend_internal_function {
/* Common elements */
zend_uchar type;
zend_internal_arg_info *arg_info;
/* END of common elements */
- void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
+ zif_handler handler;
struct _zend_module_entry *module;
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
} zend_internal_function;
static zend_op_array *(*accelerator_orig_compile_file)(zend_file_handle *file_handle, int type);
static int (*accelerator_orig_zend_stream_open_function)(const char *filename, zend_file_handle *handle );
static zend_string *(*accelerator_orig_zend_resolve_path)(const char *filename, int filename_len);
-static void (*orig_chdir)(INTERNAL_FUNCTION_PARAMETERS) = NULL;
+static zif_handler orig_chdir = NULL;
static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL;
static void accel_gen_system_id(void);
#define MAX_ACCEL_FILES 1000000
#define TOKENTOSTR(X) #X
-static void (*orig_file_exists)(INTERNAL_FUNCTION_PARAMETERS) = NULL;
-static void (*orig_is_file)(INTERNAL_FUNCTION_PARAMETERS) = NULL;
-static void (*orig_is_readable)(INTERNAL_FUNCTION_PARAMETERS) = NULL;
+static zif_handler orig_file_exists = NULL;
+static zif_handler orig_is_file = NULL;
+static zif_handler orig_is_readable = NULL;
ZEND_BEGIN_ARG_INFO(arginfo_opcache_none, 0)
ZEND_END_ARG_INFO()
return filename_is_in_cache(Z_STR(zfilename));
}
-static void accel_file_exists(INTERNAL_FUNCTION_PARAMETERS)
+static ZEND_NAMED_FUNCTION(accel_file_exists)
{
if (accel_file_in_cache(INTERNAL_FUNCTION_PARAM_PASSTHRU)) {
RETURN_TRUE;
}
}
-static void accel_is_file(INTERNAL_FUNCTION_PARAMETERS)
+static ZEND_NAMED_FUNCTION(accel_is_file)
{
if (accel_file_in_cache(INTERNAL_FUNCTION_PARAM_PASSTHRU)) {
RETURN_TRUE;
}
}
-static void accel_is_readable(INTERNAL_FUNCTION_PARAMETERS)
+static ZEND_NAMED_FUNCTION(accel_is_readable)
{
if (accel_file_in_cache(INTERNAL_FUNCTION_PARAM_PASSTHRU)) {
RETURN_TRUE;
}
/* }}} */
-static void phar_file_stat(const char *filename, size_t filename_length, int type, void (*orig_stat_func)(INTERNAL_FUNCTION_PARAMETERS), INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
+static void phar_file_stat(const char *filename, size_t filename_length, int type, zif_handler orig_stat_func, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
{
if (!filename_length) {
RETURN_FALSE;
/* }}} */
#define PharFileFunction(fname, funcnum, orig) \
-void fname(INTERNAL_FUNCTION_PARAMETERS) { \
+ZEND_NAMED_FUNCTION(fname) { \
if (!PHAR_G(intercepted)) { \
PHAR_G(orig)(INTERNAL_FUNCTION_PARAM_PASSTHRU); \
} else { \
/* }}} */
static struct _phar_orig_functions {
- void (*orig_fopen)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_file_get_contents)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_file)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_link)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_dir)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_opendir)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_file_exists)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_fileperms)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_fileinode)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filesize)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_fileowner)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filegroup)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_fileatime)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filemtime)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filectime)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filetype)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_writable)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_readable)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_executable)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_lstat)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_readfile)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_stat)(INTERNAL_FUNCTION_PARAMETERS);
+ zif_handler orig_fopen;
+ zif_handler orig_file_get_contents;
+ zif_handler orig_is_file;
+ zif_handler orig_is_link;
+ zif_handler orig_is_dir;
+ zif_handler orig_opendir;
+ zif_handler orig_file_exists;
+ zif_handler orig_fileperms;
+ zif_handler orig_fileinode;
+ zif_handler orig_filesize;
+ zif_handler orig_fileowner;
+ zif_handler orig_filegroup;
+ zif_handler orig_fileatime;
+ zif_handler orig_filemtime;
+ zif_handler orig_filectime;
+ zif_handler orig_filetype;
+ zif_handler orig_is_writable;
+ zif_handler orig_is_readable;
+ zif_handler orig_is_executable;
+ zif_handler orig_lstat;
+ zif_handler orig_readfile;
+ zif_handler orig_stat;
} phar_orig_functions = {NULL};
void phar_save_orig_functions(void) /* {{{ */
int require_hash;
int request_done;
int request_ends;
- void (*orig_fopen)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_file_get_contents)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_file)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_link)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_dir)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_opendir)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_file_exists)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_fileperms)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_fileinode)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filesize)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_fileowner)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filegroup)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_fileatime)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filemtime)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filectime)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_filetype)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_writable)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_readable)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_is_executable)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_lstat)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_readfile)(INTERNAL_FUNCTION_PARAMETERS);
- void (*orig_stat)(INTERNAL_FUNCTION_PARAMETERS);
+ zif_handler orig_fopen;
+ zif_handler orig_file_get_contents;
+ zif_handler orig_is_file;
+ zif_handler orig_is_link;
+ zif_handler orig_is_dir;
+ zif_handler orig_opendir;
+ zif_handler orig_file_exists;
+ zif_handler orig_fileperms;
+ zif_handler orig_fileinode;
+ zif_handler orig_filesize;
+ zif_handler orig_fileowner;
+ zif_handler orig_filegroup;
+ zif_handler orig_fileatime;
+ zif_handler orig_filemtime;
+ zif_handler orig_filectime;
+ zif_handler orig_filetype;
+ zif_handler orig_is_writable;
+ zif_handler orig_is_readable;
+ zif_handler orig_is_executable;
+ zif_handler orig_lstat;
+ zif_handler orig_readfile;
+ zif_handler orig_stat;
/* used for includes with . in them inside front controller */
char* cwd;
int cwd_len;
/* another quickie macro to make defining similar functions easier */
/* {{{ FileFunction(name, funcnum) */
#define FileFunction(name, funcnum) \
-void name(INTERNAL_FUNCTION_PARAMETERS) { \
+ZEND_NAMED_FUNCTION(name) { \
char *filename; \
size_t filename_len; \
\