summaryrefslogtreecommitdiff
path: root/navit/speech.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-10-27 15:58:27 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-10-27 15:58:27 +0000
commit2d931e8310372023a069ba5499b954f9ae54d206 (patch)
tree36d5f8e215140a1fc7d0225a0f357995c81d75d4 /navit/speech.c
parent8e93295b3b9e42934839ba412cf1df7af3f4b1b3 (diff)
downloadnavit-2d931e8310372023a069ba5499b954f9ae54d206.tar.gz
Fix:Core:Further cleanups
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1580 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/speech.c')
-rw-r--r--navit/speech.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/navit/speech.c b/navit/speech.c
index c9d44f494..9037129b6 100644
--- a/navit/speech.c
+++ b/navit/speech.c
@@ -20,6 +20,7 @@
#include <glib.h>
#include <string.h>
#include "debug.h"
+#include "item.h"
#include "speech.h"
#include "plugin.h"
@@ -29,19 +30,26 @@ struct speech {
};
struct speech *
-speech_new(const char *type, const char *data)
+speech_new(struct attr *parent, struct attr **attrs)
{
struct speech *this_;
struct speech_priv *(*speech_new)(const char *data, struct speech_methods *meth);
+ struct attr *type;
- dbg(1,"enter type=%s data=%s\n", type, data);
- speech_new=plugin_get_speech_type(type);
+ type=attr_search(attrs, NULL, attr_type);
+ if (! type) {
+ dbg(0,"type missing\n");
+ return NULL;
+ }
+ dbg(1,"type='%s'\n", type->u.str);
+ speech_new=plugin_get_speech_type(type->u.str);
dbg(1,"new=%p\n", speech_new);
if (! speech_new) {
+ dbg(0,"wrong type '%s'\n", type->u.str);
return NULL;
}
this_=g_new0(struct speech, 1);
- this_->priv=speech_new(data, &this_->meth);
+ this_->priv=speech_new(attrs, &this_->meth);
dbg(1, "say=%p\n", this_->meth.say);
dbg(1,"priv=%p\n", this_->priv);
if (! this_->priv) {