Back to index

tetex-bin  3.0
Classes | Defines | Typedefs | Functions | Variables
infomap.h File Reference
#include "info.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  keymap_entry

Defines

#define ESC   '\033'
#define DEL   '\177'
#define TAB   '\011'
#define RET   '\r'
#define LFD   '\n'
#define SPC   ' '
#define meta_character_threshold   (DEL + 1)
#define control_character_threshold   (SPC)
#define meta_character_bit   0x80
#define control_character_bit   0x40
#define Meta_p(c)   (((c) > meta_character_threshold))
#define Control_p(c)   ((c) < control_character_threshold)
#define Meta(c)   ((c) | (meta_character_bit))
#define UnMeta(c)   ((c) & (~meta_character_bit))
#define Control(c)   ((toupper (c)) & (~control_character_bit))
#define UnControl(c)   (tolower ((c) | control_character_bit))
#define ISFUNC   0
#define ISKMAP   1

Typedefs

typedef struct keymap_entry KEYMAP_ENTRY
typedef KEYMAP_ENTRYKeymap

Functions

Keymap keymap_make_keymap (void)
Keymap keymap_copy_keymap (Keymap map, Keymap rootmap, Keymap newroot)
void keymap_discard_keymap (Keymap map, Keymap rootmap)
void initialize_info_keymaps (void)

Variables

Keymap info_keymap
Keymap echo_area_keymap

Class Documentation

struct keymap_entry

Definition at line 53 of file infomap.h.

Collaboration diagram for keymap_entry:
Class Members
InfoCommand * function
char type

Define Documentation

#define Control (   c)    ((toupper (c)) & (~control_character_bit))

Definition at line 45 of file infomap.h.

#define control_character_bit   0x40

Definition at line 245 of file makeinfo.h.

Definition at line 35 of file infomap.h.

#define Control_p (   c)    ((c) < control_character_threshold)

Definition at line 41 of file infomap.h.

#define DEL   '\177'

Definition at line 28 of file infomap.h.

#define ESC   '\033'

Definition at line 27 of file infomap.h.

#define ISFUNC   0

Definition at line 62 of file infomap.h.

#define ISKMAP   1

Definition at line 63 of file infomap.h.

#define LFD   '\n'

Definition at line 31 of file infomap.h.

#define Meta (   c)    ((c) | (meta_character_bit))

Definition at line 43 of file infomap.h.

#define meta_character_bit   0x80

Definition at line 246 of file makeinfo.h.

#define meta_character_threshold   (DEL + 1)

Definition at line 34 of file infomap.h.

#define Meta_p (   c)    (((c) > meta_character_threshold))

Definition at line 40 of file infomap.h.

#define RET   '\r'

Definition at line 30 of file infomap.h.

#define SPC   ' '

Definition at line 32 of file infomap.h.

#define TAB   '\011'

Definition at line 29 of file infomap.h.

#define UnControl (   c)    (tolower ((c) | control_character_bit))

Definition at line 46 of file infomap.h.

#define UnMeta (   c)    ((c) & (~meta_character_bit))

Definition at line 44 of file infomap.h.


Typedef Documentation

typedef KEYMAP_ENTRY* Keymap

Definition at line 59 of file infomap.h.

typedef struct keymap_entry KEYMAP_ENTRY

Function Documentation

Definition at line 1771 of file infomap.c.

{
  int i;
  int suppress_info_default_bindings = 0;
  int suppress_ea_default_bindings = 0;

  if (!info_keymap)
    {
      info_keymap = keymap_make_keymap ();
      echo_area_keymap = keymap_make_keymap ();
    }

  /* Bind the echo area insert routines. */
  for (i = 0; i < 256; i++)
    if (isprint (i))
      echo_area_keymap[i].function = InfoCmd(ea_insert);

  /* Get user-defined keys and variables.  */
  if (fetch_user_maps())
    {
      if (user_info_keys_len && user_info_keys[0])
       suppress_info_default_bindings = 1;
      if (user_ea_keys_len && user_ea_keys[0])
       suppress_ea_default_bindings = 1;
    }

  /* Apply the default bindings, unless the user says to suppress
     them.  */
  if (vi_keys_p)
    {
      if (!suppress_info_default_bindings)
       section_to_keymaps(info_keymap, default_vi_like_info_keys,
                        sizeof(default_vi_like_info_keys));
      if (!suppress_ea_default_bindings)
         section_to_keymaps(echo_area_keymap, default_vi_like_ea_keys,
                          sizeof(default_vi_like_ea_keys));
    }
  else
    {
      if (!suppress_info_default_bindings)
       section_to_keymaps(info_keymap, default_emacs_like_info_keys,
                        sizeof(default_emacs_like_info_keys));
      if (!suppress_ea_default_bindings)
         section_to_keymaps(echo_area_keymap, default_emacs_like_ea_keys,
                          sizeof(default_emacs_like_ea_keys));
    }

  /* If the user specified custom bindings, apply them on top of the
     default ones.  */
  if (user_info_keys_len)
    section_to_keymaps(info_keymap, user_info_keys, user_info_keys_len);

  if (user_ea_keys_len)
    section_to_keymaps(echo_area_keymap, user_ea_keys, user_ea_keys_len);

  if (user_vars_len)
    section_to_vars(user_vars, user_vars_len);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Keymap keymap_copy_keymap ( Keymap  map,
Keymap  rootmap,
Keymap  newroot 
)

Definition at line 134 of file infomap.c.

{
  int i;
  Keymap keymap;
#if defined(INFOKEY)
  FUNCTION_KEYSEQ *ks;
#endif /* INFOKEY */

  keymap = keymap_make_keymap ();
  if (!newroot)
    newroot = keymap;

  for (i = 0; i < 256; i++)
    {
      keymap[i].type = map[i].type;
      switch (map[i].type)
       {
       case ISFUNC:
         keymap[i].function = map[i].function;
#if defined(INFOKEY)
         ks = find_function_keyseq (map, i, rootmap);
         if (ks)
           add_function_keyseq(map[i].function, ks->keyseq, newroot);
#endif /* INFOKEY */
         break;
       case ISKMAP:
         keymap[i].function = (InfoCommand *)keymap_copy_keymap
            ((Keymap)map[i].function, rootmap, NULL);
         break;
       }
    }
  return (keymap);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void keymap_discard_keymap ( Keymap  map,
Keymap  rootmap 
)

Definition at line 170 of file infomap.c.

{
  int i;

  if (!map)
    return;
  if (!rootmap)
    rootmap = map;

  for (i = 0; i < 256; i++)
    {
#if defined(INFOKEY)
      FUNCTION_KEYSEQ *ks;
#endif /* INFOKEY */
      switch (map[i].type)
        {
        case ISFUNC:
#if defined(INFOKEY)
         ks = find_function_keyseq(map, i, rootmap);
         if (ks)
           remove_function_keyseq (map[i].function, ks->keyseq, rootmap);
#endif /* INFOKEY */
          break;

        case ISKMAP:
          keymap_discard_keymap ((Keymap)map[i].function, rootmap);
          break;

        }
    }
  free(map);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 39 of file infomap.c.

{
  int i;
  Keymap keymap;

  keymap = (Keymap)xmalloc (256 * sizeof (KEYMAP_ENTRY));

  for (i = 0; i < 256; i++)
    {
      keymap[i].type = ISFUNC;
      keymap[i].function = (InfoCommand *)NULL;
    }

  for (i = 'A'; i < ('Z' + 1); i++)
    {
      keymap[i].type = ISFUNC;
#if defined(INFOKEY)
      keymap[Meta(i)].type = ISFUNC;
      keymap[Meta(i)].function =
#endif /* INFOKEY */
      keymap[i].function = InfoCmd(info_do_lowercase_version);
    }

  return (keymap);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 276 of file infomap.c.

Definition at line 275 of file infomap.c.