/* Return a new, empty keymap.
Free it with free() when you are done. */
Keymap
rl_make_bare_keymap ()
{ registerint i;
Keymap keymap = (Keymap)xmalloc (KEYMAP_SIZE * sizeof (KEYMAP_ENTRY));
for (i = 0; i < KEYMAP_SIZE; i++)
{
keymap[i].type = ISFUNC;
keymap[i].function = (rl_command_func_t *)NULL;
}
#if0 for (i = 'A'; i < ('Z' + 1); i++)
{
keymap[i].type = ISFUNC;
keymap[i].function = rl_do_lowercase_version;
} #endif
return (keymap);
}
/* Return a new keymap which is a copy of MAP. */
Keymap
rl_copy_keymap (map)
Keymap map;
{ registerint i;
Keymap temp;
temp = rl_make_bare_keymap (); for (i = 0; i < KEYMAP_SIZE; i++)
{
temp[i].type = map[i].type;
temp[i].function = map[i].function;
} return (temp);
}
/* Return a new keymap with the printing characters bound to rl_insert, theuppercaseMetacharactersboundtoruntheirlowercaseequivalents,
and the Meta digits bound to produce numeric arguments. */
Keymap
rl_make_keymap ()
{ registerint i;
Keymap newmap;
newmap = rl_make_bare_keymap ();
/* All ASCII printing characters are self-inserting. */ for (i = ' '; i < 127; i++)
newmap[i].function = rl_insert;
#if KEYMAP_SIZE > 128 /* Printing characters in ISO Latin-1 and some 8-bit character sets. */ for (i = 128; i < 256; i++)
newmap[i].function = rl_insert; #endif/* KEYMAP_SIZE > 128 */
return (newmap);
}
/* Free the storage associated with MAP. */ void
rl_discard_keymap (map)
Keymap map;
{ int i;
if (!map) return;
for (i = 0; i < KEYMAP_SIZE; i++)
{ switch (map[i].type)
{ case ISFUNC: break;
case ISKMAP:
rl_discard_keymap ((Keymap)map[i].function); break;
case ISMACR:
free ((char *)map[i].function); break;
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.