From fdc29843863f6f6689f0710da8abdde8373a52f8 Mon Sep 17 00:00:00 2001 From: Yury Popov Date: Sat, 19 Nov 2022 17:05:04 +0300 Subject: [PATCH] code cleanup: static uri_callback --- src/libespeak-ng/speech.c | 6 ------ src/libespeak-ng/ssml.c | 9 +++++++++ src/libespeak-ng/translate.h | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index 4e09e51c..cdbb89ba 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -84,7 +84,6 @@ static int min_buffer_length = 60; // minimum buffer length in ms static espeak_ng_STATUS err = ENS_OK; static t_espeak_callback *synth_callback = NULL; -int (*uri_callback)(int, const char *, const char *) = NULL; int (*phoneme_callback)(const char *) = NULL; char path_home[N_PATH_HOME]; // this is the espeak-ng-data directory @@ -654,11 +653,6 @@ ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback *SynthCallback) #endif } -ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char *, const char *)) -{ - uri_callback = UriCallback; -} - ESPEAK_API void espeak_SetPhonemeCallback(int (*PhonemeCallback)(const char *)) { phoneme_callback = PhonemeCallback; diff --git a/src/libespeak-ng/ssml.c b/src/libespeak-ng/ssml.c index 8905e539..32c608f9 100644 --- a/src/libespeak-ng/ssml.c +++ b/src/libespeak-ng/ssml.c @@ -87,6 +87,8 @@ static const MNEM_TAB ssmltags[] = { { NULL, 0 } }; +static int (*uri_callback)(int, const char *, const char *) = NULL; + static int attrcmp(const wchar_t *string1, const char *string2) { int ix; @@ -973,6 +975,13 @@ int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int *outix, int n_outbuf, con return 0; } +#pragma GCC visibility push(default) +ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char *, const char *)) +{ + uri_callback = UriCallback; +} +#pragma GCC visibility pop + static const MNEM_TAB xml_entity_mnemonics[] = { { "gt", '>' }, { "lt", 0xe000 + '<' }, // private usage area, to avoid confusion with XML tag diff --git a/src/libespeak-ng/translate.h b/src/libespeak-ng/translate.h index fc58e768..3fc2d4c9 100644 --- a/src/libespeak-ng/translate.h +++ b/src/libespeak-ng/translate.h @@ -649,7 +649,6 @@ extern char dictionary_name[40]; extern espeak_ng_TEXT_DECODER *p_decoder; extern int dictionary_skipwords; -extern int (*uri_callback)(int, const char *, const char *); extern int (*phoneme_callback)(const char *); #define LEADING_2_BITS 0xC0 // 0b11000000