Back to index

tetex-bin  3.0
infomap.h
Go to the documentation of this file.
00001 /* infomap.h -- description of a keymap in Info and related functions.
00002    $Id: infomap.h,v 1.3 2004/04/11 17:56:46 karl Exp $
00003 
00004    Copyright (C) 1993, 2001, 2004 Free Software Foundation, Inc.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2, or (at your option)
00009    any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software
00018    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019 
00020    Written by Brian Fox (bfox@ai.mit.edu). */
00021 
00022 #ifndef INFOMAP_H
00023 #define INFOMAP_H
00024 
00025 #include "info.h"
00026 
00027 #define ESC '\033'
00028 #define DEL '\177'
00029 #define TAB '\011'      
00030 #define RET '\r'
00031 #define LFD '\n'
00032 #define SPC ' '
00033 
00034 #define meta_character_threshold (DEL + 1)
00035 #define control_character_threshold (SPC)
00036 
00037 #define meta_character_bit 0x80
00038 #define control_character_bit 0x40
00039 
00040 #define Meta_p(c) (((c) > meta_character_threshold))
00041 #define Control_p(c) ((c) < control_character_threshold)
00042 
00043 #define Meta(c) ((c) | (meta_character_bit))
00044 #define UnMeta(c) ((c) & (~meta_character_bit))
00045 #define Control(c) ((toupper (c)) & (~control_character_bit))
00046 #define UnControl(c) (tolower ((c) | control_character_bit))
00047 
00048 /* A keymap contains one entry for each key in the ASCII set.
00049    Each entry consists of a type and a pointer.
00050    FUNCTION is the address of a function to run, or the
00051    address of a keymap to indirect through.
00052    TYPE says which kind of thing FUNCTION is. */
00053 typedef struct keymap_entry
00054 {
00055   char type;
00056   InfoCommand *function;
00057 } KEYMAP_ENTRY;
00058 
00059 typedef KEYMAP_ENTRY *Keymap;
00060 
00061 /* The values that TYPE can have in a keymap entry. */
00062 #define ISFUNC 0
00063 #define ISKMAP 1
00064 
00065 extern Keymap info_keymap;
00066 extern Keymap echo_area_keymap;
00067 
00068 /* Return a new keymap which has all the uppercase letters mapped to run
00069    the function info_do_lowercase_version (). */
00070 extern Keymap keymap_make_keymap (void);
00071 
00072 /* Return a new keymap which is a copy of MAP. */
00073 extern Keymap keymap_copy_keymap (Keymap map, Keymap rootmap,
00074     Keymap newroot);
00075 
00076 /* Free MAP and it's descendents. */
00077 extern void keymap_discard_keymap (Keymap map, Keymap rootmap);
00078 
00079 /* Initialize the info keymaps. */
00080 extern void initialize_info_keymaps (void);
00081 
00082 #endif /* not INFOMAP_H */