#undef inline
#endif
-#define ZEND_DEBUG 1
+#define ZEND_DEBUG 0
#define zend_sprintf sprintf
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "COMPILE_LIBZEND" /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "COMPILE_LIBZEND" /FR /FD /c
+# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x40d /d "NDEBUG"
# ADD RSC /l 0x40d /d "NDEBUG"
BSC32=bscmake.exe
}
-zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ...)
+
+ZEND_API zend_op_array *compile_files(int mark_as_ref ELS_DC, int file_count, ...)
+{
+ va_list files;
+ zend_op_array *op_array;
+
+ va_start(files, file_count);
+ op_array = v_compile_files(mark_as_ref ELS_CC, file_count, files);
+ va_end(files);
+ return op_array;
+}
+
+
+ZEND_API zend_op_array *v_compile_files(int mark_as_ref ELS_DC, int file_count, va_list files)
{
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
zend_op_array *original_active_op_array = CG(active_op_array);
zend_op_array *retval=NULL;
zend_file_handle *file_handle;
- va_list files;
int i;
- va_start(files, file_count);
-
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
save_lexical_state(&original_lex_state CLS_CC);
pass_include_eval(op_array);
}
}
- va_end(files);
return retval;
}
}
+
+
+/* Zend-optimized Extended functions */
+/* this function doesn't check for too many parameters */
+int getParametersEx(int param_count,...)
+{
+ void **p = EG(argument_stack).top_element-1;
+ int arg_count = (ulong) *p;
+ va_list ptr;
+ zval ***param;
+ ELS_FETCH();
+
+ if (param_count>arg_count) {
+ return FAILURE;
+ }
+
+ va_start(ptr, param_count);
+ while (param_count>0) {
+ param = va_arg(ptr, zval ***);
+ *param = (zval **) p-(param_count--);
+ }
+ va_end(ptr);
+
+ return SUCCESS;
+}
+
+
+int getParametersArrayEx(int param_count, zval ***argument_array)
+{
+ void **p = EG(argument_stack).top_element-1;
+ int arg_count = (ulong) *p;
+ ELS_FETCH();
+
+ if (param_count>arg_count) {
+ return FAILURE;
+ }
+
+ while (param_count>0) {
+ *(argument_array++) = (zval **) p-(param_count--);
+ }
+
+ return SUCCESS;
+}
+
+
int getThis(zval **this)
{
/* NEEDS TO BE IMPLEMENTED FOR ZEND */
int getParameters(int ht, int param_count,...);
int getParametersArray(int ht, int param_count, zval **argument_array);
+int getParametersEx(int param_count,...);
+int getParametersArrayEx(int param_count, zval ***argument_array);
+
int getThis(zval **this);
+
+
int ParameterPassedByReference(int ht, uint n);
int register_functions(function_entry *functions);
void unregister_functions(function_entry *functions, int count);
#include "zend_operators.h"
-zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
+ZEND_API zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
#ifndef ZTS
} list_llist_element;
-typedef struct {
+typedef struct _zend_file_handle {
int type;
char *filename;
union {
void init_compiler(CLS_D ELS_DC);
void shutdown_compiler(CLS_D);
-extern zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
+extern ZEND_API zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
int lex_scan(zval *zendlval CLS_DC);
void reset_scanner(CLS_D);
ZEND_API int require_file(zend_file_handle *file_handle CLS_DC);
ZEND_API int require_filename(char *filename CLS_DC);
ZEND_API zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ...);
+ZEND_API zend_op_array *v_compile_files(int mark_as_ref ELS_DC, int file_count, va_list files);
ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
ZEND_API zend_op_array *compile_filename(zval *filename CLS_DC);
inline int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
ZEND_API void init_op_array(zend_op_array *op_array, int initial_ops_size);
ZEND_API void destroy_op_array(zend_op_array *op_array);
-void destroy_zend_function(zend_function *function);
-void destroy_zend_class(zend_class_entry *ce);
+ZEND_API void destroy_zend_function(zend_function *function);
+ZEND_API void destroy_zend_class(zend_class_entry *ce);
zend_op *get_next_op(zend_op_array *op_array CLS_DC);
int get_next_op_number(zend_op_array *op_array);
int print_class(zend_class_entry *class_entry);
}
-void destroy_zend_function(zend_function *function)
+ZEND_API void destroy_zend_function(zend_function *function)
{
switch (function->type) {
case ZEND_USER_FUNCTION:
}
}
-void destroy_zend_class(zend_class_entry *ce)
+
+ZEND_API void destroy_zend_class(zend_class_entry *ce)
{
switch (ce->type) {
case ZEND_USER_CLASS: