2021-07-19 03:39:00 -04:00
|
|
|
#ifndef _NAMES_H_
|
|
|
|
#define _NAMES_H_
|
|
|
|
|
2021-07-20 05:34:35 -04:00
|
|
|
/* Generic uEMACS function pointer type */
|
|
|
|
typedef int (*fnp_t)( int, int) ;
|
2021-07-19 03:39:00 -04:00
|
|
|
|
2013-05-31 01:18:10 -04:00
|
|
|
/* Structure for the name binding table. */
|
2021-07-19 03:39:00 -04:00
|
|
|
typedef struct name_bind {
|
2021-07-19 23:24:32 -04:00
|
|
|
const char *n_name ; /* name starting with one tag character */
|
|
|
|
fnp_t n_func ; /* function the name is bound to */
|
2021-07-19 03:39:00 -04:00
|
|
|
} name_bind ;
|
2013-05-31 01:18:10 -04:00
|
|
|
|
2021-07-19 23:24:32 -04:00
|
|
|
#define bind_name( p) (&(p)->n_name[ 1])
|
|
|
|
#define bind_tag( p) (p)->n_name[ 0]
|
|
|
|
|
2021-07-20 05:34:35 -04:00
|
|
|
extern const name_bind names[] ; /* name to function mapping table */
|
2013-05-31 01:18:10 -04:00
|
|
|
|
2021-07-21 04:40:36 -04:00
|
|
|
const name_bind *fncmatch( char *name) ; /* look up by name */
|
|
|
|
|
2021-07-19 03:39:00 -04:00
|
|
|
#endif
|