1
0
mirror of https://github.com/rfivet/uemacs.git synced 2025-11-23 11:41:15 -05:00

Use binary search for name to function lookup. Fix name mapping table order. Rework test scripts.

This commit is contained in:
2021-07-21 16:40:36 +08:00
parent 6f7d89b1ac
commit 521d96fbda
7 changed files with 45 additions and 35 deletions

18
input.c
View File

@@ -157,24 +157,6 @@ int ectoc( int c) {
return c ;
}
/*
* match fname to a function in the names table
* and return any match or NULL if none
*
* char *fname; name to attempt to match
*/
const name_bind *fncmatch( char *fname) {
const name_bind *ffp ; /* pointer to entry in name binding table */
/* scan through the table, returning any match */
for( ffp = names ; ffp->n_func != NULL ; ffp++)
if( strcmp( fname, bind_name( ffp)) == 0)
break ;
return ffp ;
}
const name_bind *getfncnb( fnp_t func) {
const name_bind *nptr ; /* pointer into the name binding table */