return statbuf.st_size; | return statbuf.st_size; | ||||
} | } | ||||
void strncpy0(char *to, const char *from, int size) | |||||
{ | |||||
// strcpy with limit, ensures a zero terminator | |||||
strncpy(to, from, size); | |||||
to[size-1] = 0; | |||||
} | |||||
#pragma GCC visibility pop | #pragma GCC visibility pop |
#include "espeak-ng/espeak_ng.h" | #include "espeak-ng/espeak_ng.h" | ||||
extern ESPEAK_NG_API int GetFileLength(const char *filename); | extern ESPEAK_NG_API int GetFileLength(const char *filename); | ||||
extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size); | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} | } |
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | #include <espeak-ng/encoding.h> | ||||
#include "common.h" // for GetFileLength | |||||
#include "dictionary.h" // for strncpy0 | |||||
#include "common.h" // for GetFileLength, strncpy0 | |||||
#include "error.h" // for create_file_error_context | #include "error.h" // for create_file_error_context | ||||
#include "mnemonics.h" // for LookupMnemName, MNEM_TAB | #include "mnemonics.h" // for LookupMnemName, MNEM_TAB | ||||
#include "phoneme.h" // for PHONEME_TAB, PHONEME_TAB_LIST | #include "phoneme.h" // for PHONEME_TAB, PHONEME_TAB_LIST |
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | #include <espeak-ng/encoding.h> | ||||
#include "common.h" // for strncpy0 | |||||
#include "compiledict.h" | #include "compiledict.h" | ||||
#include "dictionary.h" // for EncodePhonemes, strncpy0, HashDicti... | |||||
#include "dictionary.h" // for EncodePhonemes, HashDicti... | |||||
#include "error.h" // for create_file_error_context | #include "error.h" // for create_file_error_context | ||||
#include "mnemonics.h" // for LookupMnemName, MNEM_TAB | #include "mnemonics.h" // for LookupMnemName, MNEM_TAB | ||||
#include "phoneme.h" // for PHONEME_TAB_LIST, phonSWITCH, phone... | #include "phoneme.h" // for PHONEME_TAB_LIST, phonSWITCH, phone... |
#include <espeak-ng/speak_lib.h> | #include <espeak-ng/speak_lib.h> | ||||
#include <espeak-ng/encoding.h> | #include <espeak-ng/encoding.h> | ||||
#include "common.h" // for GetFileLength | |||||
#include "common.h" // for GetFileLength, strncpy0 | |||||
#include "dictionary.h" | #include "dictionary.h" | ||||
#include "numbers.h" // for LookupAccentedLetter, Look... | #include "numbers.h" // for LookupAccentedLetter, Look... | ||||
#include "phoneme.h" // for PHONEME_TAB, phVOWEL, phon... | #include "phoneme.h" // for PHONEME_TAB, phVOWEL, phon... | ||||
'a', 'a', 'a', 'b', 'o', 'c', 'd', 'd', 'e', 'e', 'e', 'e', 'e', 'e' | 'a', 'a', 'a', 'b', 'o', 'c', 'd', 'd', 'e', 'e', 'e', 'e', 'e', 'e' | ||||
}; | }; | ||||
#pragma GCC visibility push(default) | |||||
void strncpy0(char *to, const char *from, int size) | |||||
{ | |||||
// strcpy with limit, ensures a zero terminator | |||||
strncpy(to, from, size); | |||||
to[size-1] = 0; | |||||
} | |||||
#pragma GCC visibility pop | |||||
static int Reverse4Bytes(int word) | static int Reverse4Bytes(int word) | ||||
{ | { | ||||
// reverse the order of bytes from little-endian to big-endian | // reverse the order of bytes from little-endian to big-endian |
{ | { | ||||
#endif | #endif | ||||
extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size); | |||||
int LoadDictionary(Translator *tr, const char *name, int no_error); | int LoadDictionary(Translator *tr, const char *name, int no_error); | ||||
int HashDictionary(const char *string); | int HashDictionary(const char *string); | ||||
const char *EncodePhonemes(const char *p, char *outptr, int *bad_phoneme); | const char *EncodePhonemes(const char *p, char *outptr, int *bad_phoneme); |
#include <espeak-ng/espeak_ng.h> | #include <espeak-ng/espeak_ng.h> | ||||
#include "error.h" | #include "error.h" | ||||
#include "dictionary.h" // for strncpy0 | |||||
#include "common.h" // for strncpy0 | |||||
espeak_ng_STATUS | espeak_ng_STATUS | ||||
create_file_error_context(espeak_ng_ERROR_CONTEXT *context, | create_file_error_context(espeak_ng_ERROR_CONTEXT *context, |
#include <ucd/ucd.h> | #include <ucd/ucd.h> | ||||
#include "readclause.h" | #include "readclause.h" | ||||
#include "common.h" // for GetFileLength | |||||
#include "common.h" // for GetFileLength, strncpy0 | |||||
#include "config.h" // for HAVE_MKSTEMP | #include "config.h" // for HAVE_MKSTEMP | ||||
#include "dictionary.h" // for LookupDictList, DecodePhonemes, Set... | #include "dictionary.h" // for LookupDictList, DecodePhonemes, Set... | ||||
#include "error.h" // for create_file_error_context | #include "error.h" // for create_file_error_context |
#include <ucd/ucd.h> | #include <ucd/ucd.h> | ||||
#include "ssml.h" | #include "ssml.h" | ||||
#include "dictionary.h" // for strncpy0 | |||||
#include "common.h" // for strncpy0 | |||||
#include "mnemonics.h" // for LookupMnemName, MNEM_TAB, | #include "mnemonics.h" // for LookupMnemName, MNEM_TAB, | ||||
#include "readclause.h" // for PARAM_STACK, param_stack, AddNameData | #include "readclause.h" // for PARAM_STACK, param_stack, AddNameData | ||||
#include "soundicon.h" // for LoadSoundFile2 | #include "soundicon.h" // for LoadSoundFile2 |
#include <espeak-ng/encoding.h> | #include <espeak-ng/encoding.h> | ||||
#include "translate.h" | #include "translate.h" | ||||
#include "translateword.h" | |||||
#include "common.h" // for strncpy0 | |||||
#include "dictionary.h" // for TranslateRules, LookupDictList, Cha... | #include "dictionary.h" // for TranslateRules, LookupDictList, Cha... | ||||
#include "numbers.h" // for SetSpellingStress, ... | #include "numbers.h" // for SetSpellingStress, ... | ||||
#include "phoneme.h" // for phonSWITCH, PHONEME_TAB, phonPAUSE_... | #include "phoneme.h" // for phonSWITCH, PHONEME_TAB, phonPAUSE_... | ||||
#include "synthdata.h" // for SelectPhonemeTable, LookupPhonemeTable | #include "synthdata.h" // for SelectPhonemeTable, LookupPhonemeTable | ||||
#include "ucd/ucd.h" // for ucd_toupper | #include "ucd/ucd.h" // for ucd_toupper | ||||
#include "voice.h" // for voice, voice_t | #include "voice.h" // for voice, voice_t | ||||
#include "translateword.h" | |||||
static void addPluralSuffixes(int flags, Translator *tr, char last_char, char *word_phonemes); | static void addPluralSuffixes(int flags, Translator *tr, char last_char, char *word_phonemes); | ||||
static int CheckDottedAbbrev(char *word1); | static int CheckDottedAbbrev(char *word1); |
#include <espeak-ng/encoding.h> | #include <espeak-ng/encoding.h> | ||||
#include "voice.h" // for voice_t, DoVoiceChange, N_PEAKS | #include "voice.h" // for voice_t, DoVoiceChange, N_PEAKS | ||||
#include "common.h" // for GetFileLength | |||||
#include "dictionary.h" // for strncpy0, LoadDictionary | |||||
#include "common.h" // for GetFileLength, strncpy0 | |||||
#include "dictionary.h" // for LoadDictionary | |||||
#include "mnemonics.h" // for LookupMnemName, MNEM_TAB | #include "mnemonics.h" // for LookupMnemName, MNEM_TAB | ||||
#include "phoneme.h" // for REPLACE_PHONEMES, n_replace_pho... | #include "phoneme.h" // for REPLACE_PHONEMES, n_replace_pho... | ||||
#include "speech.h" // for PATHSEP | #include "speech.h" // for PATHSEP |