Group the LookupMnem API implementations into mnemonics.c.

This commit is contained in:
Reece H. Dunn
2017-03-27 21:08:07 +01:00
parent b47363b7d3
commit d5d93be00e
6 changed files with 52 additions and 38 deletions
+1 -15
View File
@@ -17,24 +17,10 @@
#include "config.h"
#include <string.h>
#include <espeak-ng/espeak_ng.h>
#include "speech.h"
static int
LookupMnemValue(MNEM_TAB *table,
const char *string)
{
while (table->mnem != NULL) {
if (strcmp(string, table->mnem) == 0)
return table->value;
table++;
}
return table->value;
}
MNEM_TAB mnem_encoding[] = {
{ NULL, ESPEAKNG_ENCODING_UNKNOWN }
};
@@ -44,7 +30,7 @@ MNEM_TAB mnem_encoding[] = {
espeak_ng_ENCODING
espeak_ng_EncodingFromName(const char *encoding)
{
return LookupMnemValue(mnem_encoding, encoding);
return LookupMnem(mnem_encoding, encoding);
}
#pragma GCC visibility pop