summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2012-05-20 00:03:27 +0200
committerNikita Popov <nikic@php.net>2012-05-20 00:03:27 +0200
commitca59e5464de78dae1f7c874a6bcc4f7ea2948b1d (patch)
tree29b6271fe534e8e7feec73b046a1846d6758cb19
parent1cec3f12cc719ccde286a3a55f6da1a5bf9ea2e4 (diff)
downloadphp-git-ca59e5464de78dae1f7c874a6bcc4f7ea2948b1d.tar.gz
Add empty Generator class
-rw-r--r--Zend/Makefile.am3
-rw-r--r--Zend/Zend.dsp4
-rw-r--r--Zend/ZendTS.dsp4
-rw-r--r--Zend/zend_default_classes.c2
-rw-r--r--Zend/zend_generators.c47
-rw-r--r--Zend/zend_generators.h40
-rw-r--r--configure.in2
-rw-r--r--win32/build/config.w322
8 files changed, 101 insertions, 3 deletions
diff --git a/Zend/Makefile.am b/Zend/Makefile.am
index 5ec4590fef..e5757fac56 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 ebe01978c4..23ebd4532b 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 3494cd4e17..3be2c58bed 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 73a765811e..bcc43ea7db 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 0000000000..6f98dcb2c1
--- /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 <nikic@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $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 0000000000..60899072df
--- /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 <nikic@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $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 96febdd900..e9a0ef5069 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 1a4b834be4..fae3cc66c3 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);