version 1.10, 2001/05/23 22:36:14 |
version 1.11, 2001/05/23 22:56:52 |
|
|
/* $OpenBSD$ */ |
/* $OpenBSD$ */ |
|
|
/* |
/* |
* Keyboard maps. This is character set dependent. The terminal specific |
* Keyboard maps. This is character set dependent. The terminal specific |
* parts of building the keymap has been moved to a better place. |
* parts of building the keymap has been moved to a better place. |
*/ |
*/ |
|
|
|
|
static int name_fent __P((char *, int)); |
static int name_fent __P((char *, int)); |
|
|
/* |
/* |
* initial keymap declarations, deepest first |
* initial keymap declarations, deepest first |
*/ |
*/ |
|
|
#ifndef NO_HELP |
#ifndef NO_HELP |
|
|
* in name_function.) If the function is NULL, it must be listed with the |
* in name_function.) If the function is NULL, it must be listed with the |
* same name in the map_table above. |
* same name in the map_table above. |
*/ |
*/ |
FUNCTNAMES functnames[] = { |
const FUNCTNAMES functnames[] = { |
#ifndef NO_HELP |
#ifndef NO_HELP |
{apropos_command, "apropos"}, |
{apropos_command, "apropos"}, |
#endif /* !NO_HELP */ |
#endif /* !NO_HELP */ |
|
|
do { |
do { |
/* + can be used instead of | here if more efficent. */ |
/* + can be used instead of | here if more efficent. */ |
if ((try = base | x) < NFUNCT) { |
if ((try = base | x) < NFUNCT) { |
if ((notit = strcmp(fname, functnames[try].n_name)) |
if ((notit = strcmp(fname, functnames[try].n_name)) |
>= 0) { |
>= 0) { |
if (!notit) |
if (!notit) |
return try; |
return try; |
|
|
if (++i >= NFUNCT) |
if (++i >= NFUNCT) |
/* no match */ |
/* no match */ |
return NULL; |
return NULL; |
for (j = 0; (l = fname[j]) && functnames[i].n_name[j] == l; |
for (j = 0; (l = fname[j]) && functnames[i].n_name[j] == l; |
j++); |
j++); |
if (fname[j] != '\0') |
if (fname[j] != '\0') |
/* no match */ |
/* no match */ |
|
|
function_name(fpoint) |
function_name(fpoint) |
PF fpoint; |
PF fpoint; |
{ |
{ |
FUNCTNAMES *fnp = &functnames[0]; |
const FUNCTNAMES *fnp = &functnames[0]; |
|
|
if (fpoint == NULL) |
if (fpoint == NULL) |
/* ambiguous */ |
/* ambiguous */ |