X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_getch.c;h=11e8052a668c6c8a430ac660162ed3caa8259acb;hp=d8906daec63b7de903b3b82465e1c40a69bd813f;hb=88d50b5d7057d4f59c586c93ff290d0a39528f70;hpb=7a27c7d49c2e8b4a1ecbe85b4423d647cbc75ea5 diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c index d8906dae..11e8052a 100644 --- a/ncurses/base/lib_getch.c +++ b/ncurses/base/lib_getch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 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 * @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: lib_getch.c,v 1.79 2007/04/19 20:57:49 tom Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.82 2008/01/19 21:07:30 tom Exp $") #include @@ -56,6 +56,24 @@ NCURSES_EXPORT_VAR(int) ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */ #endif +#if NCURSES_EXT_FUNCS +NCURSES_EXPORT(int) +set_escdelay(int value) +{ + int code = OK; +#if USE_REENTRANT + if (SP) { + SP->_ESCDELAY = value; + } else { + code = ERR; + } +#else + ESCDELAY = value; +#endif + return code; +} +#endif + #ifdef NCURSES_WGETCH_EVENTS #define TWAIT_MASK 7 #else @@ -112,8 +130,10 @@ fifo_pull(void) h_inc(); #ifdef TRACE - if (_nc_tracing & TRACE_IEVENT) + if (USE_TRACEF(TRACE_IEVENT)) { _nc_fifo_dump(); + _nc_unlock_global(tracef); + } #endif return ch; } @@ -208,8 +228,10 @@ fifo_push(EVENTLIST_0th(_nc_eventlist * evl)) t_inc(); TR(TRACE_IEVENT, ("pushed %s at %d", _tracechar(ch), tail)); #ifdef TRACE - if (_nc_tracing & TRACE_IEVENT) + if (USE_TRACEF(TRACE_IEVENT)) { _nc_fifo_dump(); + _nc_unlock_global(tracef); + } #endif return ch; }