+#if USE_REENTRANT
+#define GetEscdelay(sp) *_nc_ptr_Escdelay(sp)
+NCURSES_EXPORT(int *)
+_nc_ptr_Escdelay(SCREEN *sp)
+{
+ return ptrEscdelay(sp);
+}
+NCURSES_EXPORT(int)
+NCURSES_PUBLIC_VAR(ESCDELAY) (void)
+{
+ return *(_nc_ptr_Escdelay(CURRENT_SCREEN));
+}
+#else
+#define GetEscdelay(sp) ESCDELAY
+NCURSES_EXPORT_VAR (int)
+ ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */
+#endif
+
+#if NCURSES_EXT_FUNCS
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(set_escdelay) (NCURSES_SP_DCLx int value)
+{
+ int code = OK;
+#if USE_REENTRANT
+ if (SP_PARM) {
+ SET_ESCDELAY(value);
+ } else {
+ code = ERR;
+ }
+#else
+ (void) SP_PARM;
+ ESCDELAY = value;
+#endif
+ return code;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+set_escdelay(int value)
+{
+ int code;
+#if USE_REENTRANT
+ code = NCURSES_SP_NAME(set_escdelay) (CURRENT_SCREEN, value);
+#else
+ ESCDELAY = value;
+ code = OK;
+#endif
+ return code;
+}
+#endif
+#endif /* NCURSES_EXT_FUNCS */
+
+#if NCURSES_EXT_FUNCS
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(get_escdelay) (NCURSES_SP_DCL0)
+{
+#if !USE_REENTRANT
+ (void) SP_PARM;
+#endif
+ return GetEscdelay(SP_PARM);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+get_escdelay (void)
+{
+ return NCURSES_SP_NAME(get_escdelay)(CURRENT_SCREEN);
+}
+#endif
+#endif /* NCURSES_EXT_FUNCS */
+
+static int
+_nc_use_meta(WINDOW *win)
+{
+ SCREEN *sp = _nc_screen_of(win);
+ return (sp ? sp->_use_meta : 0);
+}