summaryrefslogtreecommitdiff
path: root/ext/ncurses/ncurses.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2002-12-22 19:44:01 +0000
committerIlia Alshanetsky <iliaa@php.net>2002-12-22 19:44:01 +0000
commit0ae3050aa5d99ae969b49b55badabda5156c2989 (patch)
tree395c6f1ee785ccbda9b09ab97f6c90cfa23ca58a /ext/ncurses/ncurses.c
parentd70f96550c144486686f65b7d86e9f0858e5def6 (diff)
downloadphp-git-0ae3050aa5d99ae969b49b55badabda5156c2989.tar.gz
Fixed bug #21146.
Diffstat (limited to 'ext/ncurses/ncurses.c')
-rw-r--r--ext/ncurses/ncurses.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/ncurses/ncurses.c b/ext/ncurses/ncurses.c
index e69371f261..46075bd03b 100644
--- a/ext/ncurses/ncurses.c
+++ b/ext/ncurses/ncurses.c
@@ -84,19 +84,15 @@ PHP_INI_END()
#define PHP_NCURSES_CONST(x) REGISTER_LONG_CONSTANT("NCURSES_"#x, x, CONST_CS | CONST_PERSISTENT)
#define PHP_NCURSES_FKEY_CONST(x) REGISTER_LONG_CONSTANT("NCURSES_KEY_F"#x, KEY_F0 + x, CONST_CS | CONST_PERSISTENT)
-/* {{{ php_ncurses_globals_ctor */
-static void php_ncurses_globals_ctor(zend_ncurses_globals *pglobals)
+static void php_ncurses_init_globals(zend_ncurses_globals *ncurses_globals)
{
- pglobals->registered_constants = 0;
- pglobals->is_initialised = 0;
+ memset(ncurses_globals, 0, sizeof(*ncurses_globals));
}
-/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(ncurses)
{
- ZEND_INIT_MODULE_GLOBALS(ncurses, php_ncurses_globals_ctor, NULL);
/* color constants */
PHP_NCURSES_CONST(COLOR_BLACK);
PHP_NCURSES_CONST(COLOR_RED);
@@ -255,6 +251,8 @@ PHP_MINIT_FUNCTION(ncurses)
PHP_NCURSES_CONST(ALL_MOUSE_EVENTS);
PHP_NCURSES_CONST(REPORT_MOUSE_POSITION);
+ ZEND_INIT_MODULE_GLOBALS(ncurses, php_ncurses_init_globals, NULL);
+
le_ncurses_windows = zend_register_list_destructors_ex(ncurses_destruct_window, NULL, "ncurses_window", module_number);
#if HAVE_NCURSES_PANEL
le_ncurses_panels = zend_register_list_destructors_ex(ncurses_destruct_panel, NULL, "ncurses_panel", module_number);