Blame keymaps.h

Packit a71c51
/* keymaps.h -- Manipulation of readline keymaps. */
Packit a71c51
Packit a71c51
/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
Packit a71c51
Packit a71c51
   This file is part of the GNU Readline Library (Readline), a library
Packit a71c51
   for reading lines of text with interactive input and history editing.      
Packit a71c51
Packit a71c51
   Readline is free software: you can redistribute it and/or modify
Packit a71c51
   it under the terms of the GNU General Public License as published by
Packit a71c51
   the Free Software Foundation, either version 3 of the License, or
Packit a71c51
   (at your option) any later version.
Packit a71c51
Packit a71c51
   Readline is distributed in the hope that it will be useful,
Packit a71c51
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a71c51
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit a71c51
   GNU General Public License for more details.
Packit a71c51
Packit a71c51
   You should have received a copy of the GNU General Public License
Packit a71c51
   along with Readline.  If not, see <http://www.gnu.org/licenses/>.
Packit a71c51
*/
Packit a71c51
Packit a71c51
#ifndef _KEYMAPS_H_
Packit a71c51
#define _KEYMAPS_H_
Packit a71c51
Packit a71c51
#ifdef __cplusplus
Packit a71c51
extern "C" {
Packit a71c51
#endif
Packit a71c51
Packit a71c51
#if defined (READLINE_LIBRARY)
Packit a71c51
#  include "rlstdc.h"
Packit a71c51
#  include "chardefs.h"
Packit a71c51
#  include "rltypedefs.h"
Packit a71c51
#else
Packit a71c51
#  include <readline/rlstdc.h>
Packit a71c51
#  include <readline/chardefs.h>
Packit a71c51
#  include <readline/rltypedefs.h>
Packit a71c51
#endif
Packit a71c51
Packit a71c51
/* A keymap contains one entry for each key in the ASCII set.
Packit a71c51
   Each entry consists of a type and a pointer.
Packit a71c51
   FUNCTION is the address of a function to run, or the
Packit a71c51
   address of a keymap to indirect through.
Packit a71c51
   TYPE says which kind of thing FUNCTION is. */
Packit a71c51
typedef struct _keymap_entry {
Packit a71c51
  char type;
Packit a71c51
  rl_command_func_t *function;
Packit a71c51
} KEYMAP_ENTRY;
Packit a71c51
Packit a71c51
/* This must be large enough to hold bindings for all of the characters
Packit a71c51
   in a desired character set (e.g, 128 for ASCII, 256 for ISO Latin-x,
Packit a71c51
   and so on) plus one for subsequence matching. */
Packit a71c51
#define KEYMAP_SIZE 257
Packit a71c51
#define ANYOTHERKEY KEYMAP_SIZE-1
Packit a71c51
Packit a71c51
typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[KEYMAP_SIZE];
Packit a71c51
typedef KEYMAP_ENTRY *Keymap;
Packit a71c51
Packit a71c51
/* The values that TYPE can have in a keymap entry. */
Packit a71c51
#define ISFUNC 0
Packit a71c51
#define ISKMAP 1
Packit a71c51
#define ISMACR 2
Packit a71c51
Packit a71c51
extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap;
Packit a71c51
extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
Packit a71c51
Packit a71c51
/* Return a new, empty keymap.
Packit a71c51
   Free it with free() when you are done. */
Packit a71c51
extern Keymap rl_make_bare_keymap PARAMS((void));
Packit a71c51
Packit a71c51
/* Return a new keymap which is a copy of MAP. */
Packit a71c51
extern Keymap rl_copy_keymap PARAMS((Keymap));
Packit a71c51
Packit a71c51
/* Return a new keymap with the printing characters bound to rl_insert,
Packit a71c51
   the lowercase Meta characters bound to run their equivalents, and
Packit a71c51
   the Meta digits bound to produce numeric arguments. */
Packit a71c51
extern Keymap rl_make_keymap PARAMS((void));
Packit a71c51
Packit a71c51
/* Free the storage associated with a keymap. */
Packit a71c51
extern void rl_discard_keymap PARAMS((Keymap));
Packit a71c51
Packit a71c51
/* These functions actually appear in bind.c */
Packit a71c51
Packit a71c51
/* Return the keymap corresponding to a given name.  Names look like
Packit a71c51
   `emacs' or `emacs-meta' or `vi-insert'.  */
Packit a71c51
extern Keymap rl_get_keymap_by_name PARAMS((const char *));
Packit a71c51
Packit a71c51
/* Return the current keymap. */
Packit a71c51
extern Keymap rl_get_keymap PARAMS((void));
Packit a71c51
Packit a71c51
/* Set the current keymap to MAP. */
Packit a71c51
extern void rl_set_keymap PARAMS((Keymap));
Packit a71c51
Packit a71c51
#ifdef __cplusplus
Packit a71c51
}
Packit a71c51
#endif
Packit a71c51
Packit a71c51
#endif /* _KEYMAPS_H_ */