New ef_nameof_pretty()

This commit is contained in:
Markus Armbruster 2012-07-01 11:53:53 +02:00
parent 4072098c32
commit e25ff14f0c
3 changed files with 59 additions and 39 deletions

View file

@ -29,7 +29,7 @@
* Known contributors to this file:
* Dave Pare, 1989
* Steve McClure, 2000
* Markus Armbruster, 2005-2011
* Markus Armbruster, 2005-2012
*/
#include <config.h>
@ -928,14 +928,28 @@ ef_byname_from(char *name, int choices[])
return res;
}
/*
* Return name of table TYPE. Always a single, short word.
*/
char *
ef_nameof(int type)
{
if (ef_check(type) < 0)
return "bad ef_type";
return "bad";
return empfile[type].name;
}
/*
* Return "pretty" name of table TYPE.
*/
char *
ef_nameof_pretty(int type)
{
if (ef_check(type) < 0)
return "bad";
return empfile[type].pretty_name;
}
static int
ef_check(int type)
{