diff options
Diffstat (limited to 'navit/speech/speech_dispatcher/speech_speech_dispatcher.c')
-rw-r--r-- | navit/speech/speech_dispatcher/speech_speech_dispatcher.c | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/navit/speech/speech_dispatcher/speech_speech_dispatcher.c b/navit/speech/speech_dispatcher/speech_speech_dispatcher.c index d22b3f795..c7b38a26d 100644 --- a/navit/speech/speech_dispatcher/speech_speech_dispatcher.c +++ b/navit/speech/speech_dispatcher/speech_speech_dispatcher.c @@ -32,50 +32,45 @@ #include "speech.h" struct speech_priv { - SPDConnection *conn; + SPDConnection *conn; }; -static int -speechd_say(struct speech_priv *this, const char *text) { - int err; +static int speechd_say(struct speech_priv *this, const char *text) { + int err; - err = spd_sayf(this->conn, SPD_MESSAGE, text); - if (err != 1) - return 1; - return 0; + err = spd_sayf(this->conn, SPD_MESSAGE, text); + if (err != 1) + return 1; + return 0; } -static void -speechd_destroy(struct speech_priv *this) { - spd_close(this->conn); - g_free(this); +static void speechd_destroy(struct speech_priv *this) { + spd_close(this->conn); + g_free(this); } static struct speech_methods speechd_meth = { - speechd_destroy, - speechd_say, + speechd_destroy, + speechd_say, }; -static struct speech_priv * -speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *attr) { - struct speech_priv *this; - SPDConnection *conn; +static struct speech_priv *speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *attr) { + struct speech_priv *this; + SPDConnection *conn; - conn = spd_open("navit","main",NULL,SPD_MODE_SINGLE); - if (! conn) - return NULL; - this=g_new(struct speech_priv,1); - if (this) { - this->conn=conn; - *meth=speechd_meth; - spd_set_punctuation(conn, SPD_PUNCT_NONE); - } - return this; + conn = spd_open("navit","main",NULL,SPD_MODE_SINGLE); + if (! conn) + return NULL; + this=g_new(struct speech_priv,1); + if (this) { + this->conn=conn; + *meth=speechd_meth; + spd_set_punctuation(conn, SPD_PUNCT_NONE); + } + return this; } -void -plugin_init(void) -{ - plugin_register_category_speech("speech_dispatcher", speechd_new); +void plugin_init(void) { + plugin_register_category_speech("speech_dispatcher", speechd_new); } |