static unsigned char firstandsecond_args_force_ref[] = {2, BYREF_FORCE, BYREF_FORCE};
static unsigned char second_args_force_ref[] = {2, BYREF_NONE, BYREF_FORCE};
static unsigned char secondandthird_args_force_ref[] = {3, BYREF_NONE, BYREF_FORCE, BYREF_FORCE};
+static unsigned char second_thru_fourth_args_force_ref[] = {4, BYREF_NONE, BYREF_FORCE, BYREF_FORCE, BYREF_FORCE};
/* ncurses_functions[]
*
PHP_FE(ncurses_has_colors, NULL)
PHP_FE(ncurses_init, NULL)
PHP_FE(ncurses_init_pair, NULL)
+ PHP_FE(ncurses_color_content, second_thru_fourth_args_force_ref)
+ PHP_FE(ncurses_pair_content, secondandthird_args_force_ref)
PHP_FE(ncurses_move, NULL)
PHP_FE(ncurses_newwin, NULL)
PHP_FE(ncurses_refresh, NULL)
PHP_FE(ncurses_clrtobot, NULL)
PHP_FE(ncurses_clrtoeol, NULL)
PHP_FE(ncurses_def_prog_mode, NULL)
+ PHP_FE(ncurses_reset_prog_mode, NULL)
PHP_FE(ncurses_def_shell_mode, NULL)
+ PHP_FE(ncurses_reset_shell_mode, NULL)
PHP_FE(ncurses_delch, NULL)
PHP_FE(ncurses_deleteln, NULL)
PHP_FE(ncurses_doupdate, NULL)
}
/* }}} */
+/* {{{ proto int ncurses_reset_prog_mode(void)
+ Resets the prog mode saved by def_prog_mode */
+PHP_FUNCTION(ncurses_reset_prog_mode)
+{
+ if (ZEND_NUM_ARGS() != 0) {
+ WRONG_PARAM_COUNT;
+ }
+ RETURN_LONG(reset_prog_mode());
+}
+/* }}} */
+
+/* {{{ proto int ncurses_reset_shell_mode(void)
+ Resets the shell mode saved by def_shell_mode */
+PHP_FUNCTION(ncurses_reset_shell_mode)
+{
+ if (ZEND_NUM_ARGS() != 0) {
+ WRONG_PARAM_COUNT;
+ }
+ RETURN_LONG(reset_shell_mode());
+}
+/* }}} */
+
/* {{{ proto bool ncurses_def_prog_mode(void)
Saves terminals (program) mode */
PHP_FUNCTION(ncurses_def_prog_mode)
}
/* }}} */
+/* {{{ proto int ncurses_color_content(int color, int &r, int &g, int &b)
+ Gets the RGB value for color */
+PHP_FUNCTION(ncurses_color_content)
+{
+ zval **c, **r, **g, **b;
+ short rv, gv, bv;
+ int retval;
+
+ if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &c, &r, &g, &b) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long_ex(c);
+ convert_to_long_ex(r);
+ convert_to_long_ex(g);
+ convert_to_long_ex(b);
+
+ rv = Z_LVAL_PP(r);
+ gv = Z_LVAL_PP(g);
+ bv = Z_LVAL_PP(b);
+
+ retval = color_content(Z_LVAL_PP(c), &rv, &gv, &bv);
+
+ Z_LVAL_PP(r) = rv;
+ Z_LVAL_PP(g) = gv;
+ Z_LVAL_PP(b) = bv;
+
+ RETURN_LONG(retval);
+}
+/* }}} */
+
+/* {{{ proto int ncurses_pair_content(int pair, int &f, int &b)
+ Gets the RGB value for color */
+PHP_FUNCTION(ncurses_pair_content)
+{
+ zval **p, **f, **b;
+ short fv, bv;
+ int retval;
+
+ if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &p, &f, &b) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long_ex(p);
+ convert_to_long_ex(f);
+ convert_to_long_ex(b);
+
+ fv = Z_LVAL_PP(f);
+ bv = Z_LVAL_PP(b);
+
+ retval = pair_content(Z_LVAL_PP(f), &fv, &bv);
+
+ Z_LVAL_PP(f) = fv;
+ Z_LVAL_PP(b) = bv;
+
+ RETURN_LONG(retval);
+}
+/* }}} */
+
+
+
/* {{{ proto int ncurses_border(int left, int right, int top, int bottom, int tl_corner, int tr_corner, int bl_corner, int br_corner)
Draws a border around the screen using attributed characters */
PHP_FUNCTION(ncurses_border)
PHP_FUNCTION(ncurses_has_colors);
PHP_FUNCTION(ncurses_init);
PHP_FUNCTION(ncurses_init_pair);
+PHP_FUNCTION(ncurses_color_content);
+PHP_FUNCTION(ncurses_pair_content);
PHP_FUNCTION(ncurses_move);
PHP_FUNCTION(ncurses_newwin);
PHP_FUNCTION(ncurses_refresh);
PHP_FUNCTION(ncurses_clrtobot);
PHP_FUNCTION(ncurses_clrtoeol);
PHP_FUNCTION(ncurses_def_prog_mode);
+PHP_FUNCTION(ncurses_reset_prog_mode);
PHP_FUNCTION(ncurses_def_shell_mode);
+PHP_FUNCTION(ncurses_reset_shell_mode);
PHP_FUNCTION(ncurses_delch);
PHP_FUNCTION(ncurses_deleteln);
PHP_FUNCTION(ncurses_doupdate);