1999-04-16 09:34:55 +08:00
|
|
|
/* keymaps.h -- Manipulation of readline keymaps. */
|
|
|
|
|
|
|
|
/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
This file is part of the GNU Readline Library, a library for
|
|
|
|
reading lines of text with interactive input and history editing.
|
|
|
|
|
|
|
|
The GNU Readline Library is free software; you can redistribute it
|
|
|
|
and/or modify it under the terms of the GNU General Public License
|
readline:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Locally modified files: Makefile.in, configure.in, configure
(regenerated), config.h.in (regenerated), readline.h, rltty.c,
shell.c signals.c.
Locally added files: acconfig.h, config/*, config.h.bot,
cross-build/*, doc/inc-hit.texinfo.
New files: USAGE, rlprivate.h, rlshell.h, xmalloc.h.
examples:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
New files: excallback.c, rlfe.c.
doc:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Regenerated inc-hist.texinfo as copy of hsuser.texinfo, for
inclusion in the gdb manual.
New file: rluserman.texinfo
2000-07-10 01:20:00 +08:00
|
|
|
as published by the Free Software Foundation; either version 2, or
|
1999-04-16 09:34:55 +08:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
The GNU Readline Library is distributed in the hope that it will be
|
|
|
|
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
|
|
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
The GNU General Public License is often shipped with GNU software, and
|
|
|
|
is generally kept in a file called COPYING or LICENSE. If you do not
|
|
|
|
have a copy of the license, write to the Free Software Foundation,
|
readline:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Locally modified files: Makefile.in, configure.in, configure
(regenerated), config.h.in (regenerated), readline.h, rltty.c,
shell.c signals.c.
Locally added files: acconfig.h, config/*, config.h.bot,
cross-build/*, doc/inc-hit.texinfo.
New files: USAGE, rlprivate.h, rlshell.h, xmalloc.h.
examples:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
New files: excallback.c, rlfe.c.
doc:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Regenerated inc-hist.texinfo as copy of hsuser.texinfo, for
inclusion in the gdb manual.
New file: rluserman.texinfo
2000-07-10 01:20:00 +08:00
|
|
|
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
|
1999-04-16 09:34:55 +08:00
|
|
|
|
|
|
|
#ifndef _KEYMAPS_H_
|
|
|
|
#define _KEYMAPS_H_
|
|
|
|
|
readline:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Locally modified files: Makefile.in, configure.in, configure
(regenerated), config.h.in (regenerated), readline.h, rltty.c,
shell.c signals.c.
Locally added files: acconfig.h, config/*, config.h.bot,
cross-build/*, doc/inc-hit.texinfo.
New files: USAGE, rlprivate.h, rlshell.h, xmalloc.h.
examples:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
New files: excallback.c, rlfe.c.
doc:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Regenerated inc-hist.texinfo as copy of hsuser.texinfo, for
inclusion in the gdb manual.
New file: rluserman.texinfo
2000-07-10 01:20:00 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1999-04-16 09:34:55 +08:00
|
|
|
#if defined (READLINE_LIBRARY)
|
1999-08-03 07:48:02 +08:00
|
|
|
# include "rlstdc.h"
|
1999-04-16 09:34:55 +08:00
|
|
|
# include "chardefs.h"
|
|
|
|
#else
|
1999-08-03 07:48:02 +08:00
|
|
|
# include <readline/rlstdc.h>
|
1999-04-16 09:34:55 +08:00
|
|
|
# include <readline/chardefs.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined (_FUNCTION_DEF)
|
|
|
|
# define _FUNCTION_DEF
|
|
|
|
typedef int Function ();
|
|
|
|
typedef void VFunction ();
|
|
|
|
typedef char *CPFunction ();
|
|
|
|
typedef char **CPPFunction ();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* A keymap contains one entry for each key in the ASCII set.
|
|
|
|
Each entry consists of a type and a pointer.
|
|
|
|
FUNCTION is the address of a function to run, or the
|
|
|
|
address of a keymap to indirect through.
|
|
|
|
TYPE says which kind of thing FUNCTION is. */
|
|
|
|
typedef struct _keymap_entry {
|
|
|
|
char type;
|
|
|
|
Function *function;
|
|
|
|
} KEYMAP_ENTRY;
|
|
|
|
|
|
|
|
/* This must be large enough to hold bindings for all of the characters
|
|
|
|
in a desired character set (e.g, 128 for ASCII, 256 for ISO Latin-x,
|
|
|
|
and so on). */
|
|
|
|
#define KEYMAP_SIZE 256
|
|
|
|
|
|
|
|
/* I wanted to make the above structure contain a union of:
|
|
|
|
union { Function *function; struct _keymap_entry *keymap; } value;
|
|
|
|
but this made it impossible for me to create a static array.
|
|
|
|
Maybe I need C lessons. */
|
|
|
|
|
|
|
|
typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[KEYMAP_SIZE];
|
|
|
|
typedef KEYMAP_ENTRY *Keymap;
|
|
|
|
|
|
|
|
/* The values that TYPE can have in a keymap entry. */
|
|
|
|
#define ISFUNC 0
|
|
|
|
#define ISKMAP 1
|
|
|
|
#define ISMACR 2
|
|
|
|
|
|
|
|
extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap;
|
|
|
|
extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
|
|
|
|
|
|
|
|
/* Return a new, empty keymap.
|
|
|
|
Free it with free() when you are done. */
|
1999-08-03 07:48:02 +08:00
|
|
|
extern Keymap rl_make_bare_keymap __P((void));
|
1999-04-16 09:34:55 +08:00
|
|
|
|
|
|
|
/* Return a new keymap which is a copy of MAP. */
|
1999-08-03 07:48:02 +08:00
|
|
|
extern Keymap rl_copy_keymap __P((Keymap));
|
1999-04-16 09:34:55 +08:00
|
|
|
|
|
|
|
/* Return a new keymap with the printing characters bound to rl_insert,
|
|
|
|
the lowercase Meta characters bound to run their equivalents, and
|
|
|
|
the Meta digits bound to produce numeric arguments. */
|
1999-08-03 07:48:02 +08:00
|
|
|
extern Keymap rl_make_keymap __P((void));
|
1999-04-16 09:34:55 +08:00
|
|
|
|
1999-08-03 07:48:02 +08:00
|
|
|
/* Free the storage associated with a keymap. */
|
|
|
|
extern void rl_discard_keymap __P((Keymap));
|
|
|
|
|
|
|
|
/* These functions actually appear in bind.c */
|
1999-04-16 09:34:55 +08:00
|
|
|
|
|
|
|
/* Return the keymap corresponding to a given name. Names look like
|
1999-08-03 07:48:02 +08:00
|
|
|
`emacs' or `emacs-meta' or `vi-insert'. */
|
|
|
|
extern Keymap rl_get_keymap_by_name __P((char *));
|
1999-04-16 09:34:55 +08:00
|
|
|
|
|
|
|
/* Return the current keymap. */
|
1999-08-03 07:48:02 +08:00
|
|
|
extern Keymap rl_get_keymap __P((void));
|
1999-04-16 09:34:55 +08:00
|
|
|
|
|
|
|
/* Set the current keymap to MAP. */
|
1999-08-03 07:48:02 +08:00
|
|
|
extern void rl_set_keymap __P((Keymap));
|
1999-04-16 09:34:55 +08:00
|
|
|
|
readline:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Locally modified files: Makefile.in, configure.in, configure
(regenerated), config.h.in (regenerated), readline.h, rltty.c,
shell.c signals.c.
Locally added files: acconfig.h, config/*, config.h.bot,
cross-build/*, doc/inc-hit.texinfo.
New files: USAGE, rlprivate.h, rlshell.h, xmalloc.h.
examples:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
New files: excallback.c, rlfe.c.
doc:
2000-07-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Import of readline 4.1.
Regenerated inc-hist.texinfo as copy of hsuser.texinfo, for
inclusion in the gdb manual.
New file: rluserman.texinfo
2000-07-10 01:20:00 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1999-04-16 09:34:55 +08:00
|
|
|
#endif /* _KEYMAPS_H_ */
|