4 #define PHP_METHOD(CLASS, METHOD) void CLASS ## METHOD ()
5 #define PHP_FUNCTION(METHOD) void GLOBAL_ ## METHOD ()
7 'class zend_function' has no member named 'common'
16 class zvalR2
: public ZValField
20 template <class A
> bool operator == (A
&) ;
21 template <class A
> zvalR2
& operator = (A
&) ;
22 zvalR2
& operator = (int) ;
25 class zvalC2
: public ZValField
28 zvalC2
& operator ++ ();
29 zvalC2
& operator ++ (int);
30 zvalC2
& operator -- ();
31 zvalC2
& operator -- (int);
32 template <class A
> zvalC2
& operator = (A
&) ;
38 class zvalV2
: public ZValField
43 class zvalT2
: public ZValField
47 template <class T
> bool operator != (T
);
49 // bool operator != (int );
51 template <class T
> static T
MakeNullPtr();
52 template <class T
> static T
MakeNullPtrPtr();
66 // make a null pointer
67 // static zval MakeNull();
99 template <class Y
> NULLT(Y
& rY
){
100 // create a null object out of some value? well it sould always be null
104 template <class Y
> operator Y
**() const
106 // return MakeNullPtrPtr<Y>();
109 template <class Y
> operator Y
*() const
111 // return MakeNullPtr<Y*>();
114 /* template <class Y> operator Y () const
116 return Y::MakeNull();
120 operator int () const
126 // derived everything from a zval...
128 #define MYSTD(X) class X : public zval { \
133 template <class Y> X(Y & rY); \
134 template <class Y> X(Y ** pY); \
135 template <class Y> X(const Y ** pY); \
136 template <class Y> X(const Y * rY); \
137 template <class A,class B> X(A, B); \
138 template <class A,class B,class C> X(A, B, C); \
139 template <class A,class B,class C,class D> X(A, B, C, D); \
140 template <class A,class B,class C,class D,class E> X(A, B, C, D, E); \
141 template <class A,class B,class C,class D,class E,class F> X(A, B, C, D, E, F); \
142 template <class A,class B,class C,class D,class E,class F,class G> X(A,B, C, D, E, F,G); \
143 template <class A,class B,class C,class D,class E,class F,class G> X(A*,B*, C, D, E**, F,G); \
144 template <class A> operator A () const; \
145 template <class A> operator A () ; \
148 X operator ++ (int) ; \
149 X & operator -- (); \
150 X & operator -- (int); \
151 template <class A> A * operator -> () ; \
152 bool operator > (int) ; \
153 bool operator ! () ; \
156 /*bool operator == (zend_hash_has_more_elements, int )
161 // template <class A> bool operator == (const A &) const ;
162 // template <class A> bool operator == (A &) ;
165 // template <class Y,class Z> X(Y &, Z&); \
177 // template <class Y> STDRET X(const Y * rY);
178 // template <class P> STDRET X (P);
182 template <class P> STDRET X (P*); \
183 template <class Y> STDRET X(Y & rY); \
184 template <class A,class B> STDRET X(A, B); \
185 template <class A,class B,class C> STDRET X(A, B, C); \
186 template <class A,class B,class C,class D> STDRET X(A, B, C, D); \
187 template <class A,class B,class C,class D,class E> STDRET X(A, B, C, D, E); \
188 template <class A,class B,class C,class D,class E,class F> STDRET X(A, B, C, D, E, F); \
191 template <class P> STDRET* X (P*); \
192 template <class Y> STDRET* X(Y & rY); \
193 template <class A,class B> STDRET* X(A, B); \
194 template <class A,class B,class C> STDRET *X(A, B, C); \
195 template <class A,class B,class C,class D> STDRET* X(A, B, C, D); \
196 template <class A,class B,class C,class D,class E> STDRET * X(A, B, C, D, E); \
197 template <class A,class B,class C,class D,class E,class F> STDRET * X(A, B, C, D, E, F); \
203 //template <class R, class P> void X (P&);
206 MYSTDF(phc_builtin_empty
)
208 MYSTDF(phc_setup_error
)
209 MYSTDF(initialize_constructor_call
)
211 MYSTDF(phc_builtin_print
)
212 MYSTDF(zval_ptr_dtor
)
214 MYSTDF(ALLOC_INIT_ZVAL
)
216 //template <class R, class P> R Z_LVAL_P (P&);
217 //template <class R, class P> R Z_LVAL_P (P*);
218 //template <class R, class P> R Z_LVAL_P (P);
223 extern NULLT2 uninitialized_zval_ptr
;
245 MYSTD(compiled_filename
)
251 MYSTD(function_state_ptr
)
252 MYSTD(in_compilation
)
255 MYSTDF(initialize_function_call
)
259 MYSTDF(php_error_docref
)
265 MYSTD(uninitialized_zval_ptr
)
267 MYSTD(zend_fcall_infoB
)
271 MYSTDF(ZEND_NUM_ARGS
);
273 //MYSTDF(HASH_KEY_NON_EXISTANT)
275 MYSTDF(zend_hash_internal_pointer_reset_ex
)
277 MYSTDF(initialize_method_call
)
278 MYSTDF(ZEND_NUM_ARGS
)
281 MYSTDF(bitwise_and_function
)
282 MYSTDF(bitwise_not_function
)
283 MYSTDF(boolean_not_function
)
284 MYSTDF(concat_function
)
285 MYSTDF(convert_to_boolean
)
287 MYSTD(ht_iterator35472
)
288 MYSTD(ht_iterator35589
)
289 MYSTDF(increment_function
)
290 MYSTDF(is_equal_function
)
291 MYSTDF(is_identical_function
)
292 MYSTDF(is_not_equal_function
)
293 MYSTDF(is_not_identical_function
)
294 MYSTDF(is_smaller_function
)
295 MYSTDF(is_smaller_or_equal_function
)
298 MYSTDF(object_init_ex
)
299 MYSTDF(safe_free_zval_ptr
)
300 MYSTDF(shift_left_function
)
305 //MYSTDF(zend_call_function)
306 //TSTDRET zend_call_function ();
307 //template <class P> STDRET zend_call_function (P*);
308 //template <class Y> STDRET zend_call_function(Y & rY);
309 template <class T
> class STDRETT
315 template <class A
,class B
> STDRETT
<int> zend_call_function(A
*, B
*);
316 //template <class A,class B,class C> STDRET zend_call_function(A, B, C);
317 //template <class A,class B,class C,class D> STDRET zend_call_function(A, B, C, D);
318 //template <class A,class B,class C,class D,class E> STDRET zend_call_function(A, B, C, D, E);
319 //template <class A,class B,class C,class D,class E,class F> STDRET zend_call_function(A, B, C, D, E, F);
321 MYSTDF(zend_fetch_class
)
322 MYSTDF(zend_get_parameters_array
)
323 MYSTDF(zend_hash_get_current_data_ex
)
324 MYSTDF(zend_hash_get_current_key_type_ex
)
325 MYSTDF(zend_hash_internal_pointer_end_ex
)
326 MYSTDF(zend_hash_internal_pointer_reset_ex
)
327 MYSTDF(zend_hash_move_forward_ex
)
331 MYSTD(zend_functionB
)
332 MYSTD(zend_functionPC
)
333 MYSTD(zend_functionPS
)
334 MYSTD(zend_functionR
)
335 MYSTD(zend_functionC2
)
338 MYSTD(zend_functionCArg
)
339 MYSTD(zend_functionCPass
)
340 MYSTD(zend_functionCReturn
)
341 MYSTD(zend_function_name
)
343 class zend_functionC
: public zend_functionC2
346 zend_function_name function_name
;
347 zend_functionCArg arg_info
;
348 zend_functionCPass pass_rest_by_reference
;
349 zend_functionCReturn return_reference
;
352 MYSTD(zend_arg_infoB
)
353 MYSTD(zend_arg_infoR
)
357 zend_arg_infoR pass_by_reference
;
360 class zend_fcall_info
:public zend_fcall_infoB
363 // 'class zend_fcall_info' has no member named 'param_count'
364 // 'class zend_fcall_info' has no member named 'params'
365 // 'class zend_fcall_info' has no member named 'retval_ptr_ptr'
366 zend_functionPC param_count
;
367 zend_functionPS params
;
368 zend_functionR retval_ptr_ptr
;
371 template <class F
> class zend_functionPCT
: public zend_functionPC
374 zend_functionPCT
<F
> & operator=(int) const
376 // this has got to be one...
383 MYSTD(zend_hash_exists
)
384 MYSTD(zend_hash_find
)
385 MYSTDF(zend_hash_get_current_data
)
386 MYSTDF(zend_hash_get_current_key_ex
)
387 MYSTDF(zend_hash_has_more_elements
)
388 MYSTDF(zend_hash_index_del
)
389 MYSTDF(zend_hash_index_exists
)
390 MYSTDF(zend_hash_index_find
)
391 MYSTDF(zend_hash_index_update
)
392 MYSTDF(zend_hash_internal_pointer_reset
)
393 MYSTDF(zend_hash_move_forward
)
394 MYSTDF(zend_hash_next_index_insert
)
395 MYSTDF(zend_hash_quick_add
)
396 MYSTDF(zend_hash_quick_find
)
397 MYSTDF(zend_hash_update
)
401 MYSTDF(zend_symtable_find
)
402 MYSTDF(zend_symtable_update
)
411 MYSTDF(MAKE_STD_ZVAL
)
412 MYSTDF(zval_copy_ctor
)
414 MYSTDF(convert_to_array
)
415 MYSTDF(convert_to_long
)
416 MYSTDF(convert_to_string
)
421 //typedef Z_ARRVAL_P_T* Z_ARRVAL_P;
422 typedef HashTable
* Z_ARRVAL_P
;
425 #define MYSTDV(X) const NULLT X;
427 MYSTDF(ALLOC_HASHTABLE
)
433 MYSTDF(FREE_HASHTABLE
)
436 MYSTDV(ZEND_ACC_PRIVATE
)
437 MYSTDV(ZEND_ACC_PROTECTED
)
438 MYSTDV(ZEND_ACC_STATIC
)
443 MYSTDV(ZEND_ACC_PUBLIC
)
444 MYSTDV(ZEND_USER_FUNCTION
)
445 MYSTDV(ZEND_FETCH_CLASS_DEFAULT
)
446 MYSTDV(HASH_KEY_NON_EXISTANT
)
449 MYSTDV(HASH_KEY_IS_STRING
)
452 MYSTDF(assign_expr_instanceOfMyVariable
)
453 MYSTDF(bitwise_or_function
)
454 MYSTDF(boolean_xor_function
)
455 MYSTDF(convert_to_double
)
456 MYSTDF(convert_to_object
)
457 MYSTDF(decrement_function
)
458 MYSTDF(phc_check_invariants
)
459 MYSTDF(return_value_ptr
)
460 MYSTDF(shift_right_function
)
461 MYSTDF(zend_hash_destroy
)
462 MYSTDF(zend_hash_init
)
463 MYSTDF(zend_read_static_property
)
464 MYSTDF(zend_std_get_static_property
)
465 MYSTDF(zend_update_static_property
)
466 MYSTDF(get_st_entry
);
483 operator int () const ;
490 const int IS_DOUBLE
=3;
491 const int IS_ARRAY
=4;
492 const int IS_OBJECT
=5;
493 const int IS_STRING
=6;
494 const int IS_RESOURCE
=7;
496 //MYSTD(zend_fcall_info_cache_T)
498 //zend_fcall_info_cache_T [] zend_fcall_info_cache;
510 template <class T
> return_valueV
& operator=(T
&v
);
516 template <class T
> return_valueV
& operator=(T
&v
);
527 extern return_valueT2
* return_value
;
544 MYSTD(zend_class_entryB
)
545 MYSTD(zend_class_entry_name
)
547 class zend_class_entry
: public zend_class_entryB
550 zend_class_entry_name name
;
551 // static zend_class_entry * MakeNull();// make a null object?
552 template <class T
> static T
* MakeNullPtr();
553 template <class T
> static T
** MakeNullPtrPtr();
556 extern int removethissthing
;
558 class BEGIN_ARG_INFO_EX
565 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
);
566 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
,STDRET
);
567 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
,STDRET
,STDRET
);
568 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
,STDRET
,STDRET
,STDRET
);
569 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
,STDRET
,STDRET
,STDRET
,STDRET
);
570 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
);
571 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
);
572 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
);
573 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
);
574 BEGIN_ARG_INFO_EX(int A
, int B
, int C
, STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
,STDRET
);
575 BEGIN_ARG_INFO_EX(int A
, int B
, int C
);
576 BEGIN_ARG_INFO_EX(NULLT
);
581 #define ZEND_BEGIN_ARG_INFO_EX(X,A,B,C) BEGIN_ARG_INFO_EX X(A,B,C /**more stuff follows*/
583 MYSTDF(ZEND_ARG_INFOIMP
)
585 #define ZEND_ARG_INFO(X,Y) ,ZEND_ARG_INFOIMP(X,Y)
588 #define ZEND_END_ARG_INFO() ); /**end of arguments to constructor...*/
590 MYSTD(Myfunction_entry
)
591 //MYSTD(function_entry)
604 template <class A
,class B
> CreateObject (const char *, const char*, A
,B
);
605 CreateObject (const char *, const char*);
612 BEGIN_ARG_INFO_EX arginfo
;
617 #define PHP_ME(CLASS, METHOD, C ,D) \
618 {CreateObject(#CLASS , #METHOD) ,C,D},
620 MYSTDV(HASH_KEY_IS_LONG
)
623 MYSTDF(MYSsymbol_table
)
630 extern symbol_tableT symbol_table
;// global value
631 extern symbol_tableT active_symbol_table
;
634 MYSTDF(bitwise_xor_function
)
635 MYSTDF(zend_hash_add
)
640 extern class_table_t class_table
;
642 MYSTD(function_table_t
)
643 extern function_table_t function_table
;
645 // for everything else
654 zval
& operator * ();
655 // template <class A> A operator -> () ;
656 // template <class A> A operator * () ;
657 zvalP
& operator=(const zvalP
&);
658 template <class T
> bool operator != (T
);
659 template <class T
> bool operator == (T
);
660 template <class T
> bool operator = (T
);
662 //bool operator ! (class & A );
667 typedef zvalP zvalPA
;
669 template <class F
> class zend_functionRTP
680 template <class A
> A
operator -> () ;
681 template <class A
> A
operator * () ;
682 zvalPP
& operator=(const zvalPP
&);
687 the user of this class, uses this as return type.
688 so, how can we store this fact?
690 template <class F
> static void setReturnType()
692 //const zend_functionRTP<F> * pFunction
693 // this object is being used as the return type of the class F
695 // template <class A> bool operator ! (class & A );
700 this class is a return type of a class
704 template <class T
> class zvalPPReturn
: public zvalPP
708 template <class F
> static void setReturnType()
710 // this object is being used as the return type of the class F
714 //zvalPReturn<mwnamespace_getcanonicalname>::setReturnType() const
716 template <class T
, class G
>
717 void setReturnTypeDynamicT(const T
&, G val
);
719 template <class T
> class zvalPReturn
: public zvalP
722 zvalPReturn(const NULLT
&) { }
724 // zvalPReturn & operator=(const NULLT&) {}
726 static void setReturnType()
728 // this object is being used as the return type of the class F
731 template <class G
> void setReturnTypeDynamic(G val
) const
733 // setReturnTypeDynamicT<T,G>(*this,val);
735 //»setReturnTypeDynamicT(const zvalPReturn<mwnamespace_getcanonicalname>&,
736 // zend_functionRT<mwnamespace_getcanonicalname>*&)«
742 template <class F> void setReturnType() const
744 // this object is being used as the return type of the class F
749 typedef zvalPP zvalPPA
;
750 // pointer pointer pointer for arguments
753 template <class A
> A
operator -> () ;
754 template <class A
> A
operator * () ;
755 zvalPPP
& operator=(const zvalPPP
&);
756 // template <class A> bool operator ! (class & A );
760 error: new declaration 'void phc_check_invariants()'
773 template <class Y
> SmartRet
<Y
> EG(Y
* pY
);
774 template <class Y
> SmartRet
<Y
> EG(Y
& pY
);
782 MYSTDF(Z_STRVAL_P
) // string
787 MYSTDF(ZVAL_PTR_DTOR
)
796 #define MYSTDFP2(X,Y) \
801 template <class A,class B> \
803 template <class A,class B,class C> \
805 template <class A,class B,class C,class D> \
807 template <class A,class B,class C,class D,class E> \
808 Y * X(A, B, C, D, E); \
809 template <class A,class B,class C,class D,class E,class F> \
810 Y * X(A, B, C, D, E, F);
814 //MYSTDF(in_copy_on_write)
817 class Z_OBJ_HT_PP_RET
: public STDRET
820 MYSTDF(get_property_ptr_ptr
)
821 MYSTDF(read_property
)
822 MYSTDF(write_property
)
827 MYSTDFP2(Z_OBJ_HT_PP
,Z_OBJ_HT_PP_RET
)
831 simple replacements on zval
840 zvalP* operator->() ;
843 template <class T
,class G
>
847 template <class F
> class zend_functionPST
: public zend_functionPS
849 //class zend_functionPS : public zval {
851 // set the arguments value
852 //zend_functionPST <F> & operator = (zval ***);
853 // zend_functionPST <F> & operator = (zvalPPP);
854 // zend_functionPST <F> & operator = (zvalPPA *);
855 zend_functionPST
<F
> & operator = (zvalPPA
);
857 // generic template parameter
858 template <class T
> zend_functionPST
<F
> & operator = (T t
)
864 template <class F
> class zend_functionRT
: public zend_functionR
869 here we have the generic one, now we tighten it down.
871 /* zend_functionRT <F> & operator = (const zvalPP & rP)
873 //we have a parameter, now we assert the types.
874 rP.setReturnType<F>(); // this means that the parameter needs this type
878 //operator zend_functionRTP<F> ();
881 zend_functionRT
<F
> & operator = (const zvalPPReturn
<F
> & rP
)
883 //we have a parameter, now we assert the types.
884 rP
.setReturnType(); // this means that the parameter needs this type
886 zend_functionRT
<F
> & operator = (const zvalPReturn
<F
> * pP
)
888 //we have a parameter, now we assert the types.
889 //pP->setReturnType(); // this means that the parameter needs this type
890 //zvalPReturn<F>::setReturnType();
891 pP
->setReturnTypeDynamic(this);
894 zend_functionRT
<T
>& operator=
895 /*<zvalPReturn<mwnamespace_getcanonicalname>*>*/
899 // zend_functionRT<mwnamespace_getcanonicalname>& zend_functionRT<mwnamespace_getcanonicalname>::operator=<zval**>(zval**){};
901 // template <class T> zend_functionRT <F> & operator = (T);
906 template <class Function
>
907 class zend_fcall_infoT
//: public zend_fcall_info
910 zend_functionPCT
<Function
> param_count
;
911 zend_functionPST
<Function
> params
;
912 zend_functionRT
<Function
> retval_ptr_ptr
;
917 // for the call by variable
918 extern zend_fcall_info TODO_fcic
;
920 class zend_function
: public zend_functionB
923 zend_functionPC param_count
;
924 zend_functionPS params
;
925 zend_functionR retval_ptr_ptr
;
926 zend_functionC common
;
928 // static zend_function * MakeNull();// make a null object?
929 template <class T
> static T
* MakeNullPtr();
930 template <class T
> static T
** MakeNullPtrPtr();
933 typedef struct _zend_fcall_info_cache
{
934 zend_bool initialized
;
935 zend_function
*function_handler
;
936 zend_class_entry
*calling_scope
;
938 } zend_fcall_info_cache
;
940 template <class T
> class zend_fcall_info_cacheT
: public _zend_fcall_info_cache
943 template static method call
947 template <class T
> class zvalParamsT