}
/* }}} */
-/* {{{ proto int ncurses_mousemask(int newmask, int oldmask)
+/* {{{ proto int ncurses_mousemask(int newmask, int &oldmask)
Returns and sets mouse options */
PHP_FUNCTION(ncurses_mousemask)
{
Reads mouse event from queue */
PHP_FUNCTION(ncurses_getmouse)
{
- zval **arg;
+ zval **arg;
MEVENT mevent;
ulong retval;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE){
WRONG_PARAM_COUNT;
- }
+ }
pval_destructor(*arg);
array_init(*arg);
add_assoc_long(*arg, "z", mevent.z);
add_assoc_long(*arg, "mmask", mevent.bstate);
- RETURN_BOOL(retval);
+ RETURN_BOOL(retval == 0);
}
/* }}} */
int nx, ny, retval;
WINDOW **win;
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &y, &x, &toscreen) == FAILURE){
+ if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &handle, &y, &x, &toscreen) == FAILURE){
WRONG_PARAM_COUNT;
- }
+ }
FETCH_WINRES(win, handle);
ny = Z_LVAL_PP(y);
nx = Z_LVAL_PP(x);
- retval = wmouse_trafo (*win, &ny, &nx, Z_LVAL_PP(toscreen));
+ retval = wmouse_trafo (*win, &ny, &nx, Z_LVAL_PP(toscreen));
- Z_LVAL_PP(y) = ny;
- Z_LVAL_PP(x) = nx;
+ Z_LVAL_PP(y) = ny;
+ Z_LVAL_PP(x) = nx;
RETURN_BOOL(retval);
}