Import readline 8.0
[deliverable/binutils-gdb.git] / readline / keymaps.c
index 58661e298962fa457ee79b3908c0ec483bcd0a08..4ade30bcd0365771de5cfa92a3b45839fed989d1 100644 (file)
@@ -1,6 +1,6 @@
 /* keymaps.c -- Functions and keymaps for the GNU Readline library. */
 
-/* Copyright (C) 1988,1989-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1988,1989-2009,2017 Free Software Foundation, Inc.
 
    This file is part of the GNU Readline Library (Readline), a library
    for reading lines of text with interactive input and history editing.      
@@ -54,7 +54,7 @@
 /* Return a new, empty keymap.
    Free it with free() when you are done. */
 Keymap
-rl_make_bare_keymap ()
+rl_make_bare_keymap (void)
 {
   register int i;
   Keymap keymap;
@@ -77,11 +77,25 @@ rl_make_bare_keymap ()
   return (keymap);
 }
 
+/* A convenience function that returns 1 if there are no keys bound to
+   functions in KEYMAP */
+int
+rl_empty_keymap (Keymap keymap)
+{
+  int i;
+
+  for (i = 0; i < ANYOTHERKEY; i++)
+    {
+      if (keymap[i].type != ISFUNC || keymap[i].function)
+       return 0;
+    }
+  return 1;
+}
+
 /* Return a new keymap which is a copy of MAP.  Just copies pointers, does
    not copy text of macros or descend into child keymaps. */
 Keymap
-rl_copy_keymap (map)
-     Keymap map;
+rl_copy_keymap (Keymap map)
 {
   register int i;
   Keymap temp;
@@ -99,7 +113,7 @@ rl_copy_keymap (map)
    the uppercase Meta characters bound to run their lowercase equivalents,
    and the Meta digits bound to produce numeric arguments. */
 Keymap
-rl_make_keymap ()
+rl_make_keymap (void)
 {
   register int i;
   Keymap newmap;
@@ -125,8 +139,7 @@ rl_make_keymap ()
 
 /* Free the storage associated with MAP. */
 void
-rl_discard_keymap (map)
-     Keymap map;
+rl_discard_keymap (Keymap map)
 {
   int i;
 
@@ -154,8 +167,7 @@ rl_discard_keymap (map)
 
 /* Convenience function that discards, then frees, MAP. */
 void
-rl_free_keymap (map)
-     Keymap map;
+rl_free_keymap (Keymap map)
 {
   rl_discard_keymap (map);
   xfree ((char *)map);
This page took 0.029549 seconds and 4 git commands to generate.