152419Sjulian/* infomap.h -- description of a keymap in Info and related functions.
252419Sjulian   $Id: infomap.h,v 1.3 2004/04/11 17:56:46 karl Exp $
352419Sjulian
452419Sjulian   Copyright (C) 1993, 2001, 2004 Free Software Foundation, Inc.
552419Sjulian
652419Sjulian   This program is free software; you can redistribute it and/or modify
752419Sjulian   it under the terms of the GNU General Public License as published by
852419Sjulian   the Free Software Foundation; either version 2, or (at your option)
952419Sjulian   any later version.
1052419Sjulian
1152419Sjulian   This program is distributed in the hope that it will be useful,
1252419Sjulian   but WITHOUT ANY WARRANTY; without even the implied warranty of
1352419Sjulian   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1452419Sjulian   GNU General Public License for more details.
1552419Sjulian
1652419Sjulian   You should have received a copy of the GNU General Public License
1752419Sjulian   along with this program; if not, write to the Free Software
1852419Sjulian   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1952419Sjulian
2052419Sjulian   Written by Brian Fox (bfox@ai.mit.edu). */
2152419Sjulian
2252419Sjulian#ifndef INFOMAP_H
2352419Sjulian#define INFOMAP_H
2452419Sjulian
2552419Sjulian#include "info.h"
2652419Sjulian
2752419Sjulian#define ESC '\033'
2852419Sjulian#define DEL '\177'
2952419Sjulian#define TAB '\011'
3052419Sjulian#define RET '\r'
3152419Sjulian#define LFD '\n'
3252419Sjulian#define SPC ' '
3352419Sjulian
3452419Sjulian#define meta_character_threshold (DEL + 1)
3552419Sjulian#define control_character_threshold (SPC)
3652419Sjulian
3752419Sjulian#define meta_character_bit 0x80
3852419Sjulian#define control_character_bit 0x40
3952419Sjulian
40158882Sglebius#define Meta_p(c) (((c) > meta_character_threshold))
41158882Sglebius#define Control_p(c) ((c) < control_character_threshold)
42158882Sglebius
43158882Sglebius#define Meta(c) ((c) | (meta_character_bit))
44158882Sglebius#define UnMeta(c) ((c) & (~meta_character_bit))
45158882Sglebius#define Control(c) ((toupper (c)) & (~control_character_bit))
4652419Sjulian#define UnControl(c) (tolower ((c) | control_character_bit))
4752419Sjulian
4852419Sjulian/* A keymap contains one entry for each key in the ASCII set.
4952419Sjulian   Each entry consists of a type and a pointer.
5052419Sjulian   FUNCTION is the address of a function to run, or the
5152419Sjulian   address of a keymap to indirect through.
5252419Sjulian   TYPE says which kind of thing FUNCTION is. */
5352419Sjuliantypedef struct keymap_entry
5452419Sjulian{
5552419Sjulian  char type;
5652419Sjulian  InfoCommand *function;
5752419Sjulian} KEYMAP_ENTRY;
5853913Sarchie
5953913Sarchietypedef KEYMAP_ENTRY *Keymap;
6052419Sjulian
6152419Sjulian/* The values that TYPE can have in a keymap entry. */
6252419Sjulian#define ISFUNC 0
6352419Sjulian#define ISKMAP 1
6452419Sjulian
6552419Sjulianextern Keymap info_keymap;
66125115Sruextern Keymap echo_area_keymap;
67125115Sru
68125115Sru/* Return a new keymap which has all the uppercase letters mapped to run
6952419Sjulian   the function info_do_lowercase_version (). */
7052419Sjulianextern Keymap keymap_make_keymap (void);
7152419Sjulian
7252419Sjulian/* Return a new keymap which is a copy of MAP. */
7352419Sjulianextern Keymap keymap_copy_keymap (Keymap map, Keymap rootmap,
7452419Sjulian    Keymap newroot);
7552419Sjulian
7652419Sjulian/* Free MAP and it's descendents. */
7752419Sjulianextern void keymap_discard_keymap (Keymap map, Keymap rootmap);
7852419Sjulian
7952419Sjulian/* Initialize the info keymaps. */
8052419Sjulianextern void initialize_info_keymaps (void);
8152419Sjulian
8252419Sjulian#endif /* not INFOMAP_H */
8352419Sjulian