/* * v_key_len -- * Return the length of the string that will display the key. * This routine is the backup for the KEY_LEN() macro. * * PUBLIC: size_t v_key_len __P((SCR *, ARG_CHAR_T)); */ size_t v_key_len( SCR *sp, ARG_CHAR_T ch) { (void)v_key_name(sp, ch); return (sp->clen); }
/* * v_key_ilookup -- * Build the fast-lookup key display array. * * PUBLIC: void v_key_ilookup __P((SCR *)); */ void v_key_ilookup(SCR *sp) { UCHAR_T ch; char *p, *t; GS *gp; size_t len; for (gp = sp->gp, ch = 0;; ++ch) { for (p = gp->cname[ch].name, t = v_key_name(sp, ch), len = gp->cname[ch].len = sp->clen; len--;) *p++ = *t++; if (ch == MAX_FAST_KEY) break; } }