diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 3b08121b..54f0716d 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -37,10 +37,11 @@ #include "dictionary.h" // for strncpy0 #include "error.h" // for create_file_error_context +#include "mnemonics.h" // for LookupMnemName, MNEM_TAB #include "phoneme.h" // for PHONEME_TAB, PHONEME_TAB_LIST #include "readclause.h" // for Read4Bytes #include "spect.h" // for SpectFrame, peak_t, SpectSeq -#include "speech.h" // for path_home, MNEM_TAB, GetFileLength +#include "speech.h" // for path_home, GetFileLength #include "synthdata.h" // for LoadPhData #include "synthesize.h" // for TUNE, frame_t, CONDITION_IS_OTHER #include "translate.h" // for utf8_out, utf8_in diff --git a/src/libespeak-ng/compiledict.c b/src/libespeak-ng/compiledict.c index d0ff4663..0bd4c297 100644 --- a/src/libespeak-ng/compiledict.c +++ b/src/libespeak-ng/compiledict.c @@ -34,14 +34,12 @@ #include #include "compiledict.h" -#include "dictionary.h" -#include "readclause.h" - #include "dictionary.h" // for EncodePhonemes, strncpy0, HashDicti... #include "error.h" // for create_file_error_context +#include "mnemonics.h" // for LookupMnemName, MNEM_TAB #include "phoneme.h" // for PHONEME_TAB_LIST, phonSWITCH, phone... #include "readclause.h" // for towlower2 -#include "speech.h" // for LookupMnemName, MNEM_TAB, path_home +#include "speech.h" // for path_home #include "synthesize.h" // for Write4Bytes #include "translate.h" // for isspace2, IsDigit09, utf8_in, utf8_out diff --git a/src/libespeak-ng/encoding.c b/src/libespeak-ng/encoding.c index 1000008f..3ae221d2 100644 --- a/src/libespeak-ng/encoding.c +++ b/src/libespeak-ng/encoding.c @@ -27,7 +27,7 @@ #include // for espeak_ng_TEXT_DECODER, ESPEAKNG_EN... #include "espeak-ng/speak_lib.h" // for espeakCHARS_16BIT, espeakCHARS_8BIT -#include "speech.h" // for LookupMnem, MNEM_TAB +#include "mnemonics.h" // for LookupMnem, MNEM_TAB #include "translate.h" // for LEADING_2_BITS, UTF8_TAIL_BITS // http://www.iana.org/assignments/character-sets/character-sets.xhtml diff --git a/src/libespeak-ng/mnemonics.c b/src/libespeak-ng/mnemonics.c index 2cb6e6c7..c6f7a7f0 100644 --- a/src/libespeak-ng/mnemonics.c +++ b/src/libespeak-ng/mnemonics.c @@ -23,7 +23,7 @@ #include -#include "speech.h" // for MNEM_TAB, LookupMnem, LookupMnemName +#include "mnemonics.h" // for MNEM_TAB, LookupMnem, LookupMnemName int LookupMnem(MNEM_TAB *table, const char *string) { diff --git a/src/libespeak-ng/mnemonics.h b/src/libespeak-ng/mnemonics.h new file mode 100644 index 00000000..c21785dd --- /dev/null +++ b/src/libespeak-ng/mnemonics.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2005 to 2007 by Jonathan Duddington + * email: jonsd@users.sourceforge.net + * Copyright (C) 2013-2015 Reece H. Dunn + * Copyright (C) 2021 Juho Hiltunen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see: . + */ + +#ifndef ESPEAK_NG_MNEMONICS_H +#define ESPEAK_NG_MNEMONICS_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct { + const char *mnem; + int value; +} MNEM_TAB; +int LookupMnem(MNEM_TAB *table, const char *string); +const char *LookupMnemName(MNEM_TAB *table, const int value); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/libespeak-ng/speech.h b/src/libespeak-ng/speech.h index 6d2477be..31a7aa9c 100644 --- a/src/libespeak-ng/speech.h +++ b/src/libespeak-ng/speech.h @@ -59,13 +59,6 @@ extern "C" #define PATH_ESPEAK_DATA "/usr/share/espeak-ng-data" #endif -typedef struct { - const char *mnem; - int value; -} MNEM_TAB; -int LookupMnem(MNEM_TAB *table, const char *string); -const char *LookupMnemName(MNEM_TAB *table, const int value); - void cancel_audio(void); extern char path_home[N_PATH_HOME]; // this is the espeak-ng-data directory diff --git a/src/libespeak-ng/ssml.c b/src/libespeak-ng/ssml.c index d4535f46..c9ca85a1 100644 --- a/src/libespeak-ng/ssml.c +++ b/src/libespeak-ng/ssml.c @@ -41,8 +41,8 @@ #include "ssml.h" #include "dictionary.h" // for strncpy0 +#include "mnemonics.h" // for LookupMnemName, MNEM_TAB, #include "readclause.h" // for PARAM_STACK, param_stack, AddNameData -#include "speech.h" // for MNEM_TAB, LookupMnem #include "synthesize.h" // for SPEED_FACTORS, speed #include "translate.h" // for CTRL_EMBEDDED, IsDigit09, utf8_out #include "voice.h" // for SelectVoice, SelectVoiceByName diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 03626559..9ceb9c4c 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -40,8 +40,9 @@ #include "voice.h" // for voice_t, DoVoiceChange, N_PEAKS #include "dictionary.h" // for strncpy0, LoadDictionary +#include "mnemonics.h" // for LookupMnemName, MNEM_TAB #include "phoneme.h" // for REPLACE_PHONEMES, n_replace_pho... -#include "speech.h" // for LookupMnem, GetFileLength, PATHSEP +#include "speech.h" // for GetFileLength, PATHSEP #include "mbrola.h" // for LoadMbrolaTable #include "synthdata.h" // for SelectPhonemeTableName, LookupP... #include "synthesize.h" // for SetSpeed, SPEED_FACTORS, speed