[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] rename spd_conv functions to spd_*
From: |
Trevor Saunders |
Subject: |
[PATCH 2/2] rename spd_conv functions to spd_* |
Date: |
Thu, 30 Sep 2010 18:21:06 -0400 |
Hi,
On Thu, Sep 30, 2010 at 10:27:58PM +0200, Andrei Kholodnyi wrote:
> functions renamed according to the filename
hmm, I'm not sure I see any purpose in this. Also I don't think there's
any reason for the functions to have an spd_ prefix since we don't
expose them outside of the project.
Trev
> ---
> include/spd_utils.h | 19 +++++++++----------
> src/common/spd_conv.c | 20 ++++++++++----------
> src/modules/festival.c | 6 +++---
> src/modules/module_utils.c | 8 ++++----
> src/server/configuration.c | 8 ++++----
> src/server/output.c | 8 ++++----
> 6 files changed, 34 insertions(+), 35 deletions(-)
>
> diff --git a/include/spd_utils.h b/include/spd_utils.h
> index 452f37e..3255cec 100644
> --- a/include/spd_utils.h
> +++ b/include/spd_utils.h
> @@ -30,14 +30,13 @@
>
> ssize_t spd_getline(char **lineptr, size_t * n, FILE * f);
>
> -char* EVoice2str(EVoiceType voice);
> -EVoiceType str2EVoice(char* str);
> -char* EPunctMode2str(EPunctMode punct);
> -EPunctMode str2EPunctMode(char* str);
> -char* ESpellMode2str(ESpellMode spell);
> -ESpellMode str2ESpellMode(char* str);
> -char* ECapLetRecogn2str(ECapLetRecogn recogn);
> -ECapLetRecogn ECapLetRecognstr2ECapLetRecogn(char* str);
> -EVoiceType str2intpriority(char* str);
> -ECapLetRecogn str2ECapLetRecogn(char* str);
> +char* spd_voice2str(EVoiceType voice);
> +EVoiceType spd_str2voice(char* str);
> +char* spd_punct2str(EPunctMode punct);
> +EPunctMode spd_str2punct(char* str);
> +char* spd_spell2str(ESpellMode spell);
> +ESpellMode spd_str2spell(char* str);
> +char* spd_cap2str(ECapLetRecogn recogn);
> +ECapLetRecogn spd_str2cap(char* str);
> +int spd_str2prio(char* str);
> #endif /* SPD_UTILS_H */
> diff --git a/src/common/spd_conv.c b/src/common/spd_conv.c
> index 94f620e..b2cc447 100644
> --- a/src/common/spd_conv.c
> +++ b/src/common/spd_conv.c
> @@ -31,7 +31,7 @@
> #include "spd_utils.h"
>
> char*
> -EVoice2str(EVoiceType voice)
> +spd_voice2str(EVoiceType voice)
> {
> char *str;
>
> @@ -52,7 +52,7 @@ EVoice2str(EVoiceType voice)
> }
>
> EVoiceType
> -str2EVoice(char* str)
> +spd_str2voice(char* str)
> {
> EVoiceType voice;
>
> @@ -70,7 +70,7 @@ str2EVoice(char* str)
> }
>
> char*
> -EPunctMode2str(EPunctMode punct)
> +spd_punct2str(EPunctMode punct)
> {
> char *str;
>
> @@ -86,7 +86,7 @@ EPunctMode2str(EPunctMode punct)
> }
>
> EPunctMode
> -str2EPunctMode(char* str)
> +spd_str2punct(char* str)
> {
> EPunctMode punct;
>
> @@ -99,7 +99,7 @@ str2EPunctMode(char* str)
> }
>
> char*
> -ESpellMode2str(ESpellMode spell)
> +spd_spell2str(ESpellMode spell)
> {
> char *str;
>
> @@ -114,7 +114,7 @@ ESpellMode2str(ESpellMode spell)
> }
>
> ESpellMode
> -str2ESpellMode(char* str)
> +spd_str2spell(char* str)
> {
> ESpellMode spell;
>
> @@ -126,7 +126,7 @@ str2ESpellMode(char* str)
> }
>
> char*
> -ECapLetRecogn2str(ECapLetRecogn recogn)
> +spd_cap2str(ECapLetRecogn recogn)
> {
> char *str;
>
> @@ -142,7 +142,7 @@ ECapLetRecogn2str(ECapLetRecogn recogn)
> }
>
> ECapLetRecogn
> -str2ECapLetRecogn(char* str)
> +spd_str2cap(char* str)
> {
> ECapLetRecogn recogn;
>
> @@ -155,8 +155,8 @@ str2ECapLetRecogn(char* str)
> }
>
>
> -EVoiceType
> -str2intpriority(char* str)
> +int
> +spd_str2prio(char* str)
> {
> int priority;
>
> diff --git a/src/modules/festival.c b/src/modules/festival.c
> index 12b7a3b..2cac800 100644
> --- a/src/modules/festival.c
> +++ b/src/modules/festival.c
> @@ -804,7 +804,7 @@ festival_set_voice(EVoiceType voice)
> {
> char* voice_name;
>
> - voice_name = EVoice2str(voice);
> + voice_name = spd_voice2str(voice);
> FestivalSetVoice(festival_info, voice_name, NULL);
> g_free(voice_name);
> }
> @@ -838,7 +838,7 @@ void
> festival_set_punctuation_mode(EPunctMode punct)
> {
> char *punct_mode;
> - punct_mode = EPunctMode2str(punct);
> + punct_mode = spd_punct2str(punct);
> FestivalSetPunctuationMode(festival_info, punct_mode);
> g_free(punct_mode);
> }
> @@ -849,7 +849,7 @@ festival_set_cap_let_recogn(ECapLetRecogn recogn)
> char *recogn_mode;
>
> if (recogn == RECOGN_NONE) recogn_mode = NULL;
> - else recogn_mode = ECapLetRecogn2str(recogn);
> + else recogn_mode = spd_cap2str(recogn);
> FestivalSetCapLetRecogn(festival_info, recogn_mode, NULL);
> g_free(recogn_mode);
> }
> diff --git a/src/modules/module_utils.c b/src/modules/module_utils.c
> index 7a5c8f6..9d1b128 100644
> --- a/src/modules/module_utils.c
> +++ b/src/modules/module_utils.c
> @@ -189,10 +189,10 @@ do_set(void)
> SET_PARAM_NUM(rate, ((number>=-100) && (number<=100)))
> else SET_PARAM_NUM(pitch, ((number>=-100) && (number<=100)))
> else SET_PARAM_NUM(volume, ((number>=-100) && (number<=100)))
> - else SET_PARAM_STR_C(punctuation_mode, str2EPunctMode)
> - else SET_PARAM_STR_C(spelling_mode, str2ESpellMode)
> - else SET_PARAM_STR_C(cap_let_recogn, str2ECapLetRecogn)
> - else SET_PARAM_STR_C(voice, str2EVoice)
> + else SET_PARAM_STR_C(punctuation_mode, spd_str2punct)
> + else SET_PARAM_STR_C(spelling_mode, spd_str2spell)
> + else SET_PARAM_STR_C(cap_let_recogn, spd_str2cap)
> + else SET_PARAM_STR_C(voice, spd_str2voice)
> else SET_PARAM_STR(synthesis_voice)
> else SET_PARAM_STR(language)
> else err=2; /* Unknown parameter */
> diff --git a/src/server/configuration.c b/src/server/configuration.c
> index 27211f9..6edc2f1 100644
> --- a/src/server/configuration.c
> +++ b/src/server/configuration.c
> @@ -187,10 +187,10 @@ GLOBAL_FDSET_OPTION_CB_INT(DefaultVolume, volume,
> (val>=-100)&&(val<=+100), "Vol
> GLOBAL_FDSET_OPTION_CB_INT(DefaultSpelling, spelling_mode, 1, "Invalid
> spelling mode")
> GLOBAL_FDSET_OPTION_CB_INT(DefaultPauseContext, pause_context, 1, "")
>
> -GLOBAL_FDSET_OPTION_CB_SPECIAL(DefaultPriority, priority, int,
> str2intpriority)
> -GLOBAL_FDSET_OPTION_CB_SPECIAL(DefaultVoiceType, voice, EVoiceType,
> str2EVoice)
> -GLOBAL_FDSET_OPTION_CB_SPECIAL(DefaultPunctuationMode, punctuation_mode,
> EPunctMode, str2EPunctMode)
> -GLOBAL_FDSET_OPTION_CB_SPECIAL(DefaultCapLetRecognition, cap_let_recogn,
> ECapLetRecogn, str2ECapLetRecogn)
> +GLOBAL_FDSET_OPTION_CB_SPECIAL(DefaultPriority, priority, int, spd_str2prio)
> +GLOBAL_FDSET_OPTION_CB_SPECIAL(DefaultVoiceType, voice, EVoiceType,
> spd_str2voice)
> +GLOBAL_FDSET_OPTION_CB_SPECIAL(DefaultPunctuationMode, punctuation_mode,
> EPunctMode, spd_str2punct)
> +GLOBAL_FDSET_OPTION_CB_SPECIAL(DefaultCapLetRecognition, cap_let_recogn,
> ECapLetRecogn, spd_str2cap)
>
> SPEECHD_OPTION_CB_STR_M(CommunicationMethod, communication_method)
> SPEECHD_OPTION_CB_STR_M(SocketPath, socket_path)
> diff --git a/src/server/output.c b/src/server/output.c
> index 145ebd1..19f1234 100644
> --- a/src/server/output.c
> +++ b/src/server/output.c
> @@ -408,11 +408,11 @@ output_send_settings(TSpeechDMessage *msg, OutputModule
> *output)
> ADD_SET_INT(pitch);
> ADD_SET_INT(rate);
> ADD_SET_INT(volume);
> - ADD_SET_STR_C(punctuation_mode, EPunctMode2str);
> - ADD_SET_STR_C(spelling_mode, ESpellMode2str);
> - ADD_SET_STR_C(cap_let_recogn, ECapLetRecogn2str);
> + ADD_SET_STR_C(punctuation_mode, spd_punct2str);
> + ADD_SET_STR_C(spelling_mode, spd_spell2str);
> + ADD_SET_STR_C(cap_let_recogn, spd_cap2str);
> ADD_SET_STR(language);
> - ADD_SET_STR_C(voice, EVoice2str);
> + ADD_SET_STR_C(voice, spd_voice2str);
> ADD_SET_STR(synthesis_voice)
>
> SEND_CMD_N("SET");
> --
> 1.6.0.4
>
>
> _______________________________________________
> Speechd mailing list
> Speechd at lists.freebsoft.org
> http://lists.freebsoft.org/mailman/listinfo/speechd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL:
<http://lists.freebsoft.org/pipermail/speechd/attachments/20100930/29bd6ce1/attachment.pgp>