]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/lib_options.c
ncurses 5.0
[ncurses.git] / ncurses / tinfo / lib_options.c
similarity index 83%
rename from ncurses/lib_options.c
rename to ncurses/tinfo/lib_options.c
index 926a8aecf805a393bde445b298c42198c24cceb2..0bc14156d6744ab16be9037e505458f206ed5bff 100644 (file)
 #include <term.h>      /* keypad_xmit, keypad_local, meta_on, meta_off */
                        /* cursor_visible,cursor_normal,cursor_invisible */
 
-MODULE_ID("$Id: lib_options.c,v 1.29 1998/02/11 12:13:55 tom Exp $")
-
-int has_ic(void)
-{
-       T((T_CALLED("has_ic()")));
-       returnCode((insert_character || parm_ich
-          ||  (enter_insert_mode && exit_insert_mode))
-          &&  (delete_character || parm_dch));
-}
-
-int has_il(void)
-{
-       T((T_CALLED("has_il()")));
-       returnCode((insert_line || parm_insert_line)
-               && (delete_line || parm_delete_line));
-}
+MODULE_ID("$Id: lib_options.c,v 1.36 1999/10/22 21:38:57 tom Exp $")
 
 int idlok(WINDOW *win,  bool flag)
 {
@@ -122,16 +107,13 @@ int notimeout(WINDOW *win, bool f)
          returnCode(ERR);
 }
 
-int wtimeout(WINDOW *win, int delay)
+void wtimeout(WINDOW *win, int delay)
 {
        T((T_CALLED("wtimeout(%p,%d)"), win, delay));
 
        if (win) {
          win->_delay = delay;
-         returnCode(OK);
        }
-       else
-         returnCode(ERR);
 }
 
 int keypad(WINDOW *win, bool flag)
@@ -211,7 +193,7 @@ int cursor = SP->_cursor;
                break;
        }
        SP->_cursor = vis;
-       (void) fflush(SP->_ofp);
+       _nc_flush();
 
        returnCode(cursor==-1 ? 1 : cursor);
 }
@@ -230,7 +212,7 @@ int typeahead(int fd)
 **
 */
 
-
+#ifdef NCURSES_EXT_FUNCS
 static int has_key_internal(int keycode, struct tries *tp)
 {
     if (tp == 0)
@@ -247,34 +229,7 @@ int has_key(int keycode)
     T((T_CALLED("has_key(%d)"), keycode));
     returnCode(has_key_internal(keycode, SP->_keytry));
 }
-
-/*
-**      init_keytry()
-**
-**      Construct the try for the current terminal's keypad keys.
-**
-*/
-
-static void init_keytry(void)
-{
-/* LINT_PREPRO
-#if 0*/
-#include <keys.tries>
-/* LINT_PREPRO
-#endif*/
-       size_t n;
-
-       /* The SP->_keytry value is initialized in newterm(), where the SP
-        * structure is created, because we can not tell where keypad() or
-        * mouse_activate() (which will call keyok()) are first called.
-        */
-
-       for (n = 0; n < SIZEOF(table); n++)
-               if (table[n].offset < STRCOUNT)
-               _nc_add_to_try(&(SP->_keytry),
-                       CUR Strings[table[n].offset],
-                       table[n].code);
-}
+#endif /* NCURSES_EXT_FUNCS */
 
 /* Turn the keypad on/off
  *
@@ -289,17 +244,17 @@ int _nc_keypad(bool flag)
        {
            TPUTS_TRACE("keypad_xmit");
            putp(keypad_xmit);
-           (void) fflush(SP->_ofp);
+           _nc_flush();
        }
        else if (! flag  &&  keypad_local)
        {
            TPUTS_TRACE("keypad_local");
            putp(keypad_local);
-           (void) fflush(SP->_ofp);
+           _nc_flush();
        }
 
-       if (!SP->_tried) {
-           init_keytry();
+       if (flag && !SP->_tried) {
+           _nc_init_keytry();
            SP->_tried = TRUE;
        }
        return(OK);