diff --git a/Zend/Makefile.am b/Zend/Makefile.am index 5ec4590fefe..e5757fac56d 100644 --- a/Zend/Makefile.am +++ b/Zend/Makefile.am @@ -17,7 +17,8 @@ libZend_la_SOURCES=\ zend_objects_API.c zend_ts_hash.c zend_stream.c \ zend_default_classes.c \ zend_iterators.c zend_interfaces.c zend_exceptions.c \ - zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c + zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \ + zend_generators.c libZend_la_LDFLAGS = libZend_la_LIBADD = @ZEND_EXTRA_LIBS@ diff --git a/Zend/Zend.dsp b/Zend/Zend.dsp index ebe01978c4e..23ebd4532b5 100644 --- a/Zend/Zend.dsp +++ b/Zend/Zend.dsp @@ -159,6 +159,10 @@ SOURCE=.\zend_float.c # End Source File # Begin Source File +SOURCE=.\zend_generators.c +# End Source File +# Begin Source File + SOURCE=.\zend_hash.c # End Source File # Begin Source File diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp index 3494cd4e17f..3be2c58bed6 100644 --- a/Zend/ZendTS.dsp +++ b/Zend/ZendTS.dsp @@ -185,6 +185,10 @@ SOURCE=.\zend_extensions.c # End Source File # Begin Source File +SOURCE=.\zend_generators.c +# End Source File +# Begin Source File + SOURCE=.\zend_hash.c # End Source File # Begin Source File diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c index 73a765811e8..bcc43ea7db1 100644 --- a/Zend/zend_default_classes.c +++ b/Zend/zend_default_classes.c @@ -25,6 +25,7 @@ #include "zend_interfaces.h" #include "zend_exceptions.h" #include "zend_closures.h" +#include "zend_generators.h" ZEND_API void zend_register_default_classes(TSRMLS_D) @@ -33,6 +34,7 @@ ZEND_API void zend_register_default_classes(TSRMLS_D) zend_register_default_exception(TSRMLS_C); zend_register_iterator_wrapper(TSRMLS_C); zend_register_closure_ce(TSRMLS_C); + zend_register_generator_ce(TSRMLS_C); } /* diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c new file mode 100644 index 00000000000..6f98dcb2c1c --- /dev/null +++ b/Zend/zend_generators.c @@ -0,0 +1,47 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | If you did not receive a copy of the Zend license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@zend.com so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Nikita Popov | + +----------------------------------------------------------------------+ +*/ + +/* $Id$ */ + +#include "zend.h" +#include "zend_API.h" +#include "zend_generators.h" + +ZEND_API zend_class_entry *zend_ce_generator; + +static const zend_function_entry generator_functions[] = { + ZEND_FE_END +}; + +void zend_register_generator_ce(TSRMLS_D) /* {{{ */ +{ + zend_class_entry ce; + + INIT_CLASS_ENTRY(ce, "Generator", generator_functions); + zend_ce_generator = zend_register_internal_class(&ce TSRMLS_CC); + zend_ce_generator->ce_flags |= ZEND_ACC_FINAL_CLASS; +} +/* }}} */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + */ diff --git a/Zend/zend_generators.h b/Zend/zend_generators.h new file mode 100644 index 00000000000..60899072dff --- /dev/null +++ b/Zend/zend_generators.h @@ -0,0 +1,40 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | If you did not receive a copy of the Zend license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@zend.com so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Nikita Popov | + +----------------------------------------------------------------------+ +*/ + +/* $Id$ */ + +#ifndef ZEND_GENERATORS_H +#define ZEND_GENERATORS_H + +BEGIN_EXTERN_C() + +void zend_register_generator_ce(TSRMLS_D); + +extern ZEND_API zend_class_entry *zend_ce_generator; + +END_EXTERN_C() + +#endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + */ diff --git a/configure.in b/configure.in index 96febdd9000..e9a0ef5069a 100644 --- a/configure.in +++ b/configure.in @@ -1472,7 +1472,7 @@ PHP_ADD_SOURCES(Zend, \ zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \ zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \ zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \ - zend_closures.c zend_float.c zend_string.c zend_signal.c) + zend_closures.c zend_float.c zend_string.c zend_signal.c zend_generators.c) if test -r "$abs_srcdir/Zend/zend_objects.c"; then PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c zend_default_classes.c) diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 1a4b834be42..fae3cc66c30 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -359,7 +359,7 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \ zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \ zend_object_handlers.c zend_objects_API.c \ zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c \ - zend_float.c zend_string.c"); + zend_float.c zend_string.c zend_generators.c"); if (VCVERS == 1200) { AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);