diff options
author | Tom Tromey <tom@tromey.com> | 2019-08-12 10:24:03 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-08-12 10:57:56 -0600 |
commit | cb41b9e70e6fbd1cb603bb9ba4372fbb8ae87b20 (patch) | |
tree | 6b03a978514e9f7df56c1243a3796776ecc65198 /readline/keymaps.c | |
parent | ca2589f3bbad1e151abbb293d4c43a87b7a4d5ec (diff) | |
download | fsf-binutils-gdb-cb41b9e70e6fbd1cb603bb9ba4372fbb8ae87b20.zip fsf-binutils-gdb-cb41b9e70e6fbd1cb603bb9ba4372fbb8ae87b20.tar.gz fsf-binutils-gdb-cb41b9e70e6fbd1cb603bb9ba4372fbb8ae87b20.tar.bz2 |
Import readline 8.0
This imports readline 8.0.
readline/ChangeLog.gdb
2019-08-12 Tom Tromey <tom@tromey.com>
* Imported readline 8.0.
Diffstat (limited to 'readline/keymaps.c')
-rw-r--r-- | readline/keymaps.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/readline/keymaps.c b/readline/keymaps.c index 58661e2..4ade30b 100644 --- a/readline/keymaps.c +++ b/readline/keymaps.c @@ -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); |