home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / OS2 / gnuinfo.zip / info / infomap.h < prev    next >
C/C++ Source or Header  |  1997-07-15  |  3KB  |  83 lines

  1. /* infomap.h -- Description of a keymap in Info and related functions. */
  2.  
  3. /* This file is part of GNU Info, a program for reading online documentation
  4.    stored in Info format.
  5.  
  6.    Copyright (C) 1993 Free Software Foundation, Inc.
  7.  
  8.    This program is free software; you can redistribute it and/or modify
  9.    it under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2, or (at your option)
  11.    any later version.
  12.  
  13.    This program is distributed in the hope that it will be useful,
  14.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.    GNU General Public License for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with this program; if not, write to the Free Software
  20.    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21.  
  22.    Written by Brian Fox (bfox@ai.mit.edu). */
  23.  
  24. #ifndef INFOMAP_H
  25. #define INFOMAP_H
  26.  
  27. #include "info.h"
  28.  
  29. #define ESC '\033'
  30. #define DEL '\177'
  31. #define TAB '\011'      
  32. #define RET '\r'
  33. #define LFD '\n'
  34. #define SPC ' '
  35.  
  36. #define meta_character_threshold (DEL + 1)
  37. #define control_character_threshold (SPC)
  38.  
  39. #define meta_character_bit 0x80
  40. #define control_character_bit 0x40
  41.  
  42. #define Meta_p(c) (((c) > meta_character_threshold))
  43. #define Control_p(c) ((c) < control_character_threshold)
  44.  
  45. #define Meta(c) ((c) | (meta_character_bit))
  46. #define UnMeta(c) ((c) & (~meta_character_bit))
  47. #define Control(c) ((toupper (c)) & (~control_character_bit))
  48. #define UnControl(c) (tolower ((c) | control_character_bit))
  49.  
  50. /* A keymap contains one entry for each key in the ASCII set.
  51.    Each entry consists of a type and a pointer.
  52.    FUNCTION is the address of a function to run, or the
  53.    address of a keymap to indirect through.
  54.    TYPE says which kind of thing FUNCTION is. */
  55. typedef struct {
  56.   char type;
  57.   VFunction *function;
  58. } KEYMAP_ENTRY;
  59.  
  60. typedef KEYMAP_ENTRY *Keymap;
  61.  
  62. /* The values that TYPE can have in a keymap entry. */
  63. #define ISFUNC 0
  64. #define ISKMAP 1
  65.  
  66. extern Keymap info_keymap;
  67. extern Keymap echo_area_keymap;
  68.  
  69. /* Return a new keymap which has all the uppercase letters mapped to run
  70.    the function info_do_lowercase_version (). */
  71. extern Keymap keymap_make_keymap ();
  72.  
  73. /* Return a new keymap which is a copy of MAP. */
  74. extern Keymap keymap_copy_keymap ();
  75.  
  76. /* Free MAP and it's descendents. */
  77. extern void keymap_discard_keymap ();
  78.  
  79. /* Initialize the info keymaps. */
  80. extern void initialize_info_keymaps ();
  81.  
  82. #endif /* not INFOMAP_H */
  83.