summaryrefslogtreecommitdiff
path: root/navit/speech/dbus/speech_dbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/speech/dbus/speech_dbus.c')
-rw-r--r--navit/speech/dbus/speech_dbus.c62
1 files changed, 28 insertions, 34 deletions
diff --git a/navit/speech/dbus/speech_dbus.c b/navit/speech/dbus/speech_dbus.c
index 0fdfb71ab..a3d60620c 100644
--- a/navit/speech/dbus/speech_dbus.c
+++ b/navit/speech/dbus/speech_dbus.c
@@ -28,50 +28,44 @@
#include "speech.h"
struct speech_priv {
- struct navit *nav;
+ struct navit *nav;
};
-static int
-speech_dbus_say(struct speech_priv *this, const char *text)
-{
- struct attr attr1,attr2,cb,*attr_list[3];
- int valid=0;
- attr1.type=attr_type;
- attr1.u.str="speech";
- attr2.type=attr_data;
- attr2.u.str=(char *)text;
- attr_list[0]=&attr1;
- attr_list[1]=&attr2;
- attr_list[2]=NULL;
- if (navit_get_attr(this->nav, attr_callback_list, &cb, NULL))
- callback_list_call_attr_4(cb.u.callback_list, attr_command, "dbus_send_signal", attr_list, NULL, &valid);
- return 0;
+static int speech_dbus_say(struct speech_priv *this, const char *text) {
+ struct attr attr1,attr2,cb,*attr_list[3];
+ int valid=0;
+ attr1.type=attr_type;
+ attr1.u.str="speech";
+ attr2.type=attr_data;
+ attr2.u.str=(char *)text;
+ attr_list[0]=&attr1;
+ attr_list[1]=&attr2;
+ attr_list[2]=NULL;
+ if (navit_get_attr(this->nav, attr_callback_list, &cb, NULL))
+ callback_list_call_attr_4(cb.u.callback_list, attr_command, "dbus_send_signal", attr_list, NULL, &valid);
+ return 0;
}
-static void
-speech_dbus_destroy(struct speech_priv *this) {
- g_free(this);
+static void speech_dbus_destroy(struct speech_priv *this) {
+ g_free(this);
}
static struct speech_methods speech_dbus_meth = {
- speech_dbus_destroy,
- speech_dbus_say,
+ speech_dbus_destroy,
+ speech_dbus_say,
};
-static struct speech_priv *
-speech_dbus_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) {
- struct speech_priv *this;
- if (!parent || parent->type != attr_navit)
- return NULL;
- this=g_new(struct speech_priv,1);
- this->nav=parent->u.navit;
- *meth=speech_dbus_meth;
- return this;
+static struct speech_priv *speech_dbus_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent) {
+ struct speech_priv *this;
+ if (!parent || parent->type != attr_navit)
+ return NULL;
+ this=g_new(struct speech_priv,1);
+ this->nav=parent->u.navit;
+ *meth=speech_dbus_meth;
+ return this;
}
-void
-plugin_init(void)
-{
- plugin_register_category_speech("dbus", speech_dbus_new);
+void plugin_init(void) {
+ plugin_register_category_speech("dbus", speech_dbus_new);
}