]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_getch.c
ncurses 5.6 - patch 20080119
[ncurses.git] / ncurses / base / lib_getch.c
index d8906daec63b7de903b3b82465e1c40a69bd813f..11e8052a668c6c8a430ac660162ed3caa8259acb 100644 (file)
@@ -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 <curses.priv.h>
 
-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 <fifo_defs.h>
 
@@ -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;
 }