X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_options.c;h=8e31d484bfff6691e820c30cf187be4d17b47b3c;hp=5aaef4684f6ac599b25a0dadb9e0a72f8cbe5205;hb=7d3e03f12f3e179f5780f733fa5b78d981080d48;hpb=3f5a74a97cf8d86a8a8a78c7b268f49ccdc4101c diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index 5aaef468..8e31d484 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -46,17 +46,21 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_options.c,v 1.70 2009/08/16 14:16:38 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.77 2014/03/08 20:32:59 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) { int res = ERR; - T((T_CALLED("idlok(%p,%d)"), win, flag)); + T((T_CALLED("idlok(%p,%d)"), (void *) win, flag)); if (win) { SCREEN *sp = _nc_screen_of(win); - if (sp && IsTermInfo(sp)) { + if (sp != 0 +#ifdef USE_TERM_DRIVER + && IsTermInfo(sp) +#endif + ) { sp->_nc_sp_idlok = win->_idlok = (flag && (NCURSES_SP_NAME(has_il) (NCURSES_SP_ARG) || change_scroll_region)); @@ -69,7 +73,7 @@ idlok(WINDOW *win, bool flag) NCURSES_EXPORT(void) idcok(WINDOW *win, bool flag) { - T((T_CALLED("idcok(%p,%d)"), win, flag)); + T((T_CALLED("idcok(%p,%d)"), (void *) win, flag)); if (win) { SCREEN *sp = _nc_screen_of(win); @@ -81,7 +85,7 @@ idcok(WINDOW *win, bool flag) NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t) { - T((T_CALLED("halfdelay(%p,%d)"), SP_PARM, t)); + T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t)); if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM)) returnCode(ERR); @@ -102,7 +106,7 @@ halfdelay(int t) NCURSES_EXPORT(int) nodelay(WINDOW *win, bool flag) { - T((T_CALLED("nodelay(%p,%d)"), win, flag)); + T((T_CALLED("nodelay(%p,%d)"), (void *) win, flag)); if (win) { if (flag == TRUE) @@ -117,7 +121,7 @@ nodelay(WINDOW *win, bool flag) NCURSES_EXPORT(int) notimeout(WINDOW *win, bool f) { - T((T_CALLED("notimeout(%p,%d)"), win, f)); + T((T_CALLED("notimeout(%p,%d)"), (void *) win, f)); if (win) { win->_notimeout = f; @@ -129,7 +133,7 @@ notimeout(WINDOW *win, bool f) NCURSES_EXPORT(void) wtimeout(WINDOW *win, int delay) { - T((T_CALLED("wtimeout(%p,%d)"), win, delay)); + T((T_CALLED("wtimeout(%p,%d)"), (void *) win, delay)); if (win) { win->_delay = delay; @@ -140,7 +144,7 @@ wtimeout(WINDOW *win, int delay) NCURSES_EXPORT(int) keypad(WINDOW *win, bool flag) { - T((T_CALLED("keypad(%p,%d)"), win, flag)); + T((T_CALLED("keypad(%p,%d)"), (void *) win, flag)); if (win) { win->_use_keypad = flag; @@ -156,7 +160,7 @@ meta(WINDOW *win GCC_UNUSED, bool flag) SCREEN *sp = (win == 0) ? CURRENT_SCREEN : _nc_screen_of(win); /* Ok, we stay relaxed and don't signal an error if win is NULL */ - T((T_CALLED("meta(%p,%d)"), win, flag)); + T((T_CALLED("meta(%p,%d)"), (void *) win, flag)); /* Ok, we stay relaxed and don't signal an error if win is NULL */ @@ -165,16 +169,16 @@ meta(WINDOW *win GCC_UNUSED, bool flag) #ifdef USE_TERM_DRIVER if (IsTermInfo(sp)) { if (flag) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); + NCURSES_PUTP2("meta_on", meta_on); } else { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); + NCURSES_PUTP2("meta_off", meta_off); } } #else if (flag) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); + NCURSES_PUTP2("meta_on", meta_on); } else { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); + NCURSES_PUTP2("meta_off", meta_off); } #endif result = OK; @@ -188,7 +192,7 @@ NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis) { int code = ERR; - T((T_CALLED("curs_set(%p,%d)"), SP_PARM, vis)); + T((T_CALLED("curs_set(%p,%d)"), (void *) SP_PARM, vis)); if (SP_PARM != 0 && vis >= 0 && vis <= 2) { int cursor = SP_PARM->_cursor; @@ -199,19 +203,16 @@ NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis) if (!bBuiltIn) { switch (vis) { case 2: - code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "cursor_visible", - cursor_visible); + code = NCURSES_PUTP2_FLUSH("cursor_visible", + cursor_visible); break; case 1: - code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "cursor_normal", - cursor_normal); + code = NCURSES_PUTP2_FLUSH("cursor_normal", + cursor_normal); break; case 0: - code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "cursor_invisible", - cursor_invisible); + code = NCURSES_PUTP2_FLUSH("cursor_invisible", + cursor_invisible); break; } } else @@ -235,7 +236,7 @@ curs_set(int vis) NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd) { - T((T_CALLED("typeahead(%p, %d)"), SP_PARM, fd)); + T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd)); if (IsValidTIScreen(SP_PARM)) { SP_PARM->_checkfd = fd; returnCode(OK); @@ -283,7 +284,7 @@ TINFO_HAS_KEY(SCREEN *sp, int keycode) NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (NCURSES_SP_DCLx int keycode) { - T((T_CALLED("has_key(%p,%d)"), SP_PARM, keycode)); + T((T_CALLED("has_key(%p,%d)"), (void *) SP_PARM, keycode)); returnCode(SP != 0 ? has_key_internal(keycode, SP_PARM->_keytry) : FALSE); } @@ -301,7 +302,7 @@ NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx const char *name, const char *value) { - int rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value); + int rc = NCURSES_PUTP2(name, value); if (rc != ERR) { _nc_flush(); } @@ -324,7 +325,7 @@ _nc_putp_flush(const char *name, const char *value) * the terminal state _before_ switching modes. */ NCURSES_EXPORT(int) -_nc_keypad(SCREEN *sp, bool flag) +_nc_keypad(SCREEN *sp, int flag) { int rc = ERR; @@ -349,18 +350,14 @@ _nc_keypad(SCREEN *sp, bool flag) #endif { #ifdef USE_TERM_DRIVER - rc = CallDriver_1(sp, kpad, flag); + rc = CallDriver_1(sp, td_kpad, flag); if (rc == OK) sp->_keypad_on = flag; #else if (flag) { - (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "keypad_xmit", - keypad_xmit); + (void) NCURSES_PUTP2_FLUSH("keypad_xmit", keypad_xmit); } else if (!flag && keypad_local) { - (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "keypad_local", - keypad_local); + (void) NCURSES_PUTP2_FLUSH("keypad_local", keypad_local); } if (flag && !sp->_tried) {