speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] create a library of common routines


From: william hubbs
Subject: [PATCH 4/4] create a library of common routines
Date: Mon, 13 Sep 2010 17:47:43 -0500

From: William Hubbs <address@hidden>
To: address@hidden

Move the code in the intl/ subdirectory to src/common and convert it
into a convenience library so that it can be linked with the modules and
server.

Move the include files from intl/ to include/ so that they can be easily
included by the server and modules.

Rename intl/fdset.h to include/speechd_types.h since this better
describes the contents of the file.  These types are to be shared
between the server and modules.
---
 Makefile.am                   |    4 +-
 configure.ac                  |    3 +-
 doc/speech-dispatcher.texi    |    4 +-
 include/Makefile.am           |    4 +
 include/fdsetconv.h           |   28 +++++++
 include/speechd_types.h       |   91 ++++++++++++++++++++++
 intl/fdset.h                  |   93 -----------------------
 intl/fdsetconv.c              |  165 -----------------------------------------
 intl/fdsetconv.h              |   31 --------
 src/Makefile.am               |    5 +-
 src/audio/Makefile.am         |    2 +-
 src/c/api/Makefile.am         |    2 +-
 src/c/clients/say/Makefile.am |    2 +-
 src/common/Makefile.am        |    6 ++
 src/common/fdsetconv.c        |  165 +++++++++++++++++++++++++++++++++++++++++
 src/modules/Makefile.am       |   20 +++---
 src/modules/cicero.c          |    2 +-
 src/modules/dummy.c           |    2 +-
 src/modules/espeak.c          |    2 +-
 src/modules/festival.c        |    2 +-
 src/modules/flite.c           |    2 +-
 src/modules/generic.c         |    2 +-
 src/modules/ibmtts.c          |    2 +-
 src/modules/ivona.c           |    2 +-
 src/modules/module_utils.c    |    4 +-
 src/modules/module_utils.h    |    4 +-
 src/server/Makefile.am        |    4 +-
 src/server/config.c           |    2 +-
 src/server/output.c           |    3 +-
 src/server/server.c           |    2 +-
 src/server/speaking.h         |    2 +-
 src/server/speechd.h          |    2 +-
 src/tests/Makefile.am         |    2 +-
 33 files changed, 333 insertions(+), 333 deletions(-)
 create mode 100644 include/Makefile.am
 create mode 100644 include/fdsetconv.h
 create mode 100644 include/speechd_types.h
 delete mode 100644 intl/fdset.h
 delete mode 100644 intl/fdsetconv.c
 delete mode 100644 intl/fdsetconv.h
 create mode 100644 src/common/Makefile.am
 create mode 100644 src/common/fdsetconv.c

diff --git a/Makefile.am b/Makefile.am
index 822e876..91f670e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS= src config doc po
+SUBDIRS= include src config doc po
 
-EXTRA_DIST=  intl build.sh
+EXTRA_DIST=  build.sh
 
 MAINTAINERCLEANFILES=configure
diff --git a/configure.ac b/configure.ac
index 129fa49..d36e016 100644
--- a/configure.ac
+++ b/configure.ac
@@ -414,5 +414,4 @@ AC_SUBST(RDYNAMIC)
 localedir=${datadir}/locale
 AC_SUBST(localedir)
 
-AC_OUTPUT([Makefile src/Makefile src/server/Makefile src/modules/Makefile 
src/c/Makefile src/c/api/Makefile src/c/clients/Makefile 
src/c/clients/say/Makefile src/c/clients/spdsend/Makefile src/tests/Makefile 
src/audio/Makefile src/audio/static_plugins.c config/Makefile 
config/modules/Makefile config/clients/Makefile doc/Makefile 
src/python/Makefile src/python/speechd/Makefile 
src/python/speechd_config/Makefile po/Makefile.in])
-
+AC_OUTPUT([Makefile include/Makefile src/Makefile src/common/Makefile 
src/server/Makefile src/modules/Makefile src/c/Makefile src/c/api/Makefile 
src/c/clients/Makefile src/c/clients/say/Makefile 
src/c/clients/spdsend/Makefile src/tests/Makefile src/audio/Makefile 
src/audio/static_plugins.c config/Makefile config/modules/Makefile 
config/clients/Makefile doc/Makefile src/python/Makefile 
src/python/speechd/Makefile src/python/speechd_config/Makefile po/Makefile.in])
diff --git a/doc/speech-dispatcher.texi b/doc/speech-dispatcher.texi
index 36695bc..d015a4f 100644
--- a/doc/speech-dispatcher.texi
+++ b/doc/speech-dispatcher.texi
@@ -2648,7 +2648,7 @@ corresponding SSIP commands, except that they are written 
with small
 letters. @xref{Top,,Parameter Setting Commands,ssip, SSIP
 Documentation}.  The conversion between these string values and the
 corresponding C enum variables can be easily done using
- at file{intl/fdsetconv.c}.
+ at file{src/common/fdsetconv.c}.
 
 Not all of these parameters must be set and the value of the string
 arguments can also be @code{NULL}. If some of the parameters aren't
@@ -3055,7 +3055,7 @@ differently, if the synthesizer supports it).
 
 Each output module should take care of setting the output device to
 the parameters from msg_settings (defined in module_utils.h) (See
-SPDMsgSettings in @file{intl/fdset.h}). However, it is not an error if
+SPDMsgSettings in @file{module_utils.h}). However, it is not an error if
 some of these values are ignored. At least rate, pitch and language
 should be set correctly.
 
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644
index 0000000..7767fb2
--- /dev/null
+++ b/include/Makefile.am
@@ -0,0 +1,4 @@
+## Process this file with automake to produce Makefile.in
+
+noinst_HEADERS = fdsetconv.h speechd_types.h
+
diff --git a/include/fdsetconv.h b/include/fdsetconv.h
new file mode 100644
index 0000000..2a5809f
--- /dev/null
+++ b/include/fdsetconv.h
@@ -0,0 +1,28 @@
+#ifndef FDSETCONV_H
+#define FDSETCONV_H
+
+#include <stdio.h>
+#include <string.h>
+#include <speechd_types.h>
+
+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);
+
+#endif
diff --git a/include/speechd_types.h b/include/speechd_types.h
new file mode 100644
index 0000000..2f3a32d
--- /dev/null
+++ b/include/speechd_types.h
@@ -0,0 +1,91 @@
+
+/*
+ * speechd_types.h - types for Speech Dispatcher
+ *
+ * Copyright (C) 2001, 2002, 2003 Brailcom, o.p.s.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this package; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SPEECHD_TYPES_H
+#define SPEECHD_TYPES_H
+
+typedef enum
+    {                  /* Type of voice */
+       NO_VOICE = 0,
+       MALE1 = 1,
+       MALE2 = 2,
+       MALE3 = 3,
+       FEMALE1 = 4,
+       FEMALE2 = 5,
+       FEMALE3 = 6,
+       CHILD_MALE = 7,
+       CHILD_FEMALE = 8
+    }EVoiceType;
+
+typedef enum
+    {
+       SORT_BY_TIME = 0,
+       SORT_BY_ALPHABET = 1
+    }ESort;
+
+typedef enum
+    {
+       MSGTYPE_TEXT = 0,
+       MSGTYPE_SOUND_ICON = 1,
+       MSGTYPE_CHAR = 2,
+       MSGTYPE_KEY = 3,
+       MSGTYPE_SPELL = 99
+    }EMessageType;
+
+typedef enum
+    {
+       RECOGN_NONE = 0,
+       RECOGN_SPELL = 1,
+       RECOGN_ICON = 2
+    }ECapLetRecogn;
+
+typedef enum
+    {
+       PUNCT_NONE = 0,
+       PUNCT_ALL = 1,
+       PUNCT_SOME = 2
+    }EPunctMode;
+
+typedef enum
+    {
+       SPELLING_OFF = 0,
+       SPELLING_ON = 1
+    }ESpellMode;
+
+typedef enum
+    {
+       NOTIFY_NOTHING = 0,
+       NOTIFY_BEGIN = 1,
+       NOTIFY_END = 2,
+       NOTIFY_IM = 4,
+       NOTIFY_CANCEL = 8,
+       NOTIFY_PAUSE = 16,
+       NOTIFY_RESUME = 32
+    }ENotification;
+
+typedef struct {
+  char* name;
+  char* language;
+  char* dialect;
+}VoiceDescription;
+
+#endif /* not ifndef SPEECHD_TYPES */
diff --git a/intl/fdset.h b/intl/fdset.h
deleted file mode 100644
index 21b10d7..0000000
--- a/intl/fdset.h
+++ /dev/null
@@ -1,93 +0,0 @@
-
-/*
- * fdset.h - Settings for Speech Dispatcher
- *
- * Copyright (C) 2001, 2002, 2003 Brailcom, o.p.s.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this package; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * $Id: fdset.h,v 1.33 2008-06-09 10:28:08 hanke Exp $
- */
-
-#ifndef FDSET_H
-#define FDSET_H
-
-typedef enum 
-    {                  /* Type of voice */
-       NO_VOICE = 0,
-       MALE1 = 1,
-       MALE2 = 2,
-       MALE3 = 3,
-       FEMALE1 = 4,
-       FEMALE2 = 5,
-       FEMALE3 = 6,
-       CHILD_MALE = 7,
-       CHILD_FEMALE = 8
-    }EVoiceType;
-
-typedef enum
-    {
-       SORT_BY_TIME = 0,
-       SORT_BY_ALPHABET = 1
-    }ESort;
-
-typedef enum
-    {
-       MSGTYPE_TEXT = 0,
-       MSGTYPE_SOUND_ICON = 1,
-       MSGTYPE_CHAR = 2,
-       MSGTYPE_KEY = 3,
-       MSGTYPE_SPELL = 99
-    }EMessageType;
-
-typedef enum
-    {
-       RECOGN_NONE = 0,
-       RECOGN_SPELL = 1,
-       RECOGN_ICON = 2
-    }ECapLetRecogn;
-
-typedef enum
-    {
-       PUNCT_NONE = 0,
-       PUNCT_ALL = 1,
-       PUNCT_SOME = 2
-    }EPunctMode;
-
-typedef enum
-    {
-       SPELLING_OFF = 0,
-       SPELLING_ON = 1
-    }ESpellMode;
-
-typedef enum
-    {
-       NOTIFY_NOTHING = 0,
-       NOTIFY_BEGIN = 1,
-       NOTIFY_END = 2,
-       NOTIFY_IM = 4,
-       NOTIFY_CANCEL = 8,
-       NOTIFY_PAUSE = 16,
-       NOTIFY_RESUME = 32
-    }ENotification;
-
-typedef struct {
-  char* name;
-  char* language;
-  char* dialect;
-}VoiceDescription;
-
-#endif /* not ifndef FDSET */
diff --git a/intl/fdsetconv.c b/intl/fdsetconv.c
deleted file mode 100644
index e98d32c..0000000
--- a/intl/fdsetconv.c
+++ /dev/null
@@ -1,165 +0,0 @@
-
-/*
- * fdsetconv.c - Conversion of types for Speech Dispatcher
- *
- * Copyright (C) 2001, 2002, 2003 Brailcom, o.p.s.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this package; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- * $Id: fdsetconv.c,v 1.5 2007-06-21 20:09:45 hanke Exp $
- */
-
-#include "fdsetconv.h"
-
-char*
-EVoice2str(EVoiceType voice)
-{
-    char *str;
-
-    switch (voice)
-        {
-        case MALE1: str = strdup("male1"); break;
-        case MALE2: str = strdup("male2"); break;
-        case MALE3: str = strdup("male3"); break;
-        case FEMALE1: str = strdup("female1"); break;
-        case FEMALE2: str = strdup("female2"); break;
-        case FEMALE3: str = strdup("female3"); break;
-        case CHILD_MALE: str = strdup("child_male"); break;
-        case CHILD_FEMALE: str = strdup("child_female"); break;
-        default: str = NULL;
-        }
-
-    return str;
-}
-
-EVoiceType
-str2EVoice(char* str)
-{
-    EVoiceType voice;
-
-    if (!strcmp(str, "male1")) voice = MALE1;
-    else if (!strcmp(str, "male2")) voice = MALE2;
-    else if (!strcmp(str, "male3")) voice = MALE3;
-    else if (!strcmp(str, "female1")) voice = FEMALE1;
-    else if (!strcmp(str, "female2")) voice = FEMALE2;
-    else if (!strcmp(str, "female3")) voice = FEMALE3;
-    else if (!strcmp(str, "child_male")) voice = CHILD_MALE;
-    else if (!strcmp(str, "child_female")) voice = CHILD_FEMALE;
-    else voice = NO_VOICE;
-
-    return voice;
-}
-
-char*
-EPunctMode2str(EPunctMode punct)
-{
-    char *str;
-
-    switch (punct)
-        {
-        case PUNCT_NONE: str = strdup("none"); break;
-        case PUNCT_ALL: str = strdup("all"); break;
-        case PUNCT_SOME: str = strdup("some"); break;
-        default: str = NULL;
-        }
-
-    return str;
-}
-
-EPunctMode
-str2EPunctMode(char* str)
-{
-    EPunctMode punct;
-
-    if (!strcmp(str, "none")) punct = PUNCT_NONE;
-    else if (!strcmp(str, "all")) punct = PUNCT_ALL;
-    else if (!strcmp(str, "some")) punct = PUNCT_SOME;
-    else punct = -1;
-
-    return punct;
-}
-
-char*
-ESpellMode2str(ESpellMode spell)
-{
-    char *str;
-
-    switch (spell)
-        {
-        case SPELLING_ON: str = strdup("on"); break;
-        case SPELLING_OFF: str = strdup("off"); break;
-        default: str = NULL;
-        }
-
-    return str;
-}
-
-ESpellMode
-str2ESpellMode(char* str)
-{
-    ESpellMode spell;
-
-    if (!strcmp(str, "on")) spell = SPELLING_ON;
-    else if (!strcmp(str, "off")) spell = SPELLING_OFF;
-    else spell = -1;
-
-    return spell;
-}
-
-char*
-ECapLetRecogn2str(ECapLetRecogn recogn)
-{
-    char *str;
-
-    switch (recogn)
-        {
-        case RECOGN_NONE: str = strdup("none"); break;
-        case RECOGN_SPELL: str = strdup("spell"); break;
-        case RECOGN_ICON: str = strdup("icon"); break;
-        default: str = NULL;
-        }
-
-    return str;
-}
-
-ECapLetRecogn
-str2ECapLetRecogn(char* str)
-{
-    ECapLetRecogn recogn;
-
-    if (!strcmp(str, "none")) recogn = RECOGN_NONE;
-    else if (!strcmp(str, "spell")) recogn = RECOGN_SPELL;
-    else if (!strcmp(str, "icon")) recogn = RECOGN_ICON;
-    else recogn = -1;
-
-    return recogn;
-}
-
-
-EVoiceType
-str2intpriority(char* str)
-{
-    int priority;
-
-    if (!strcmp(str, "important"))  priority = 1;
-    else if (!strcmp(str, "text")) priority = 2;
-    else if (!strcmp(str, "message")) priority = 3;
-    else if (!strcmp(str, "notification")) priority = 4;
-    else if (!strcmp(str, "progress")) priority = 5;
-    else priority = -1;
-
-    return priority;
-}
diff --git a/intl/fdsetconv.h b/intl/fdsetconv.h
deleted file mode 100644
index 240ca27..0000000
--- a/intl/fdsetconv.h
+++ /dev/null
@@ -1,31 +0,0 @@
-
-#include "fdset.h"
-
-#ifndef FDSETCONV_H
-#define FDSETCONV_H
-
-#include <stdio.h>
-#include <string.h>
-#include "fdset.h"
-
-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);
-
-#endif
diff --git a/src/Makefile.am b/src/Makefile.am
index fa6a695..5bb50ef 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -10,12 +10,11 @@ EXTRA_DIST = cl/ChangeLog cl/README cl/configuration.lisp 
cl/elisp.lisp \
              guile/ChangeLog guile/Makefile guile/README guile/gssip.scm.in \
              guile/gssip.c guile/gssip.h
 
-SUBDIRS=server audio c modules tests
+SUBDIRS=common server audio c modules tests
 
 if HAVE_PYTHON
 SUBDIRS += python
 endif
 
-DIST_SUBDIRS=server audio c modules tests python
-
+DIST_SUBDIRS=common server audio c modules tests python
 
diff --git a/src/audio/Makefile.am b/src/audio/Makefile.am
index 98d5efa..d356d46 100644
--- a/src/audio/Makefile.am
+++ b/src/audio/Makefile.am
@@ -1,6 +1,6 @@
 
 localedir = $(datadir)/locale
-inc_local = "-I$(top_srcdir)/intl/"
+inc_local = "-I$(top_srcdir)/include/"
 
 include_HEADERS = spd_audio_plugin.h
 
diff --git a/src/c/api/Makefile.am b/src/c/api/Makefile.am
index d8a1cbd..1c380a5 100644
--- a/src/c/api/Makefile.am
+++ b/src/c/api/Makefile.am
@@ -1,6 +1,6 @@
 
 localedir = $(datadir)/locale
-inc_local = "-I$(top_srcdir)/intl/"
+inc_local = "-I$(top_srcdir)/include/"
 
 AM_CFLAGS = @ERROR_CFLAGS@ -DLOCALEDIR=\"$(localedir)\" -D_GNU_SOURCE 
-I/usr/include/ $(inc_local) @glib_include@ 
-DSPD_SPAWN_CMD=\""@prefix@/bin/speech-dispatcher"\"
 
diff --git a/src/c/clients/say/Makefile.am b/src/c/clients/say/Makefile.am
index 345decf..efb4bca 100644
--- a/src/c/clients/say/Makefile.am
+++ b/src/c/clients/say/Makefile.am
@@ -1,6 +1,6 @@
 
 localedir = $(datadir)/locale
-inc_local = "-I$(top_srcdir)/intl/"
+inc_local = "-I$(top_srcdir)/include/"
 c_api = $(top_builddir)/src/c/api
 
 AM_CFLAGS = -DLOCALEDIR=\"$(localedir)\" $(inc_local) @glib_include@ 
-I$(top_srcdir)/src/c/api
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
new file mode 100644
index 0000000..be17ce9
--- /dev/null
+++ b/src/common/Makefile.am
@@ -0,0 +1,6 @@
+## Process this file with automake to produce Makefile.in
+
+noinst_LTLIBRARIES = libcommon.la
+libcommon_la_CFLAGS = @ERROR_CFLAGS@
+libcommon_la_CPPFLAGS = "-I$(top_srcdir)/include/"
+libcommon_la_SOURCES = fdsetconv.c
diff --git a/src/common/fdsetconv.c b/src/common/fdsetconv.c
new file mode 100644
index 0000000..e98d32c
--- /dev/null
+++ b/src/common/fdsetconv.c
@@ -0,0 +1,165 @@
+
+/*
+ * fdsetconv.c - Conversion of types for Speech Dispatcher
+ *
+ * Copyright (C) 2001, 2002, 2003 Brailcom, o.p.s.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this package; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * $Id: fdsetconv.c,v 1.5 2007-06-21 20:09:45 hanke Exp $
+ */
+
+#include "fdsetconv.h"
+
+char*
+EVoice2str(EVoiceType voice)
+{
+    char *str;
+
+    switch (voice)
+        {
+        case MALE1: str = strdup("male1"); break;
+        case MALE2: str = strdup("male2"); break;
+        case MALE3: str = strdup("male3"); break;
+        case FEMALE1: str = strdup("female1"); break;
+        case FEMALE2: str = strdup("female2"); break;
+        case FEMALE3: str = strdup("female3"); break;
+        case CHILD_MALE: str = strdup("child_male"); break;
+        case CHILD_FEMALE: str = strdup("child_female"); break;
+        default: str = NULL;
+        }
+
+    return str;
+}
+
+EVoiceType
+str2EVoice(char* str)
+{
+    EVoiceType voice;
+
+    if (!strcmp(str, "male1")) voice = MALE1;
+    else if (!strcmp(str, "male2")) voice = MALE2;
+    else if (!strcmp(str, "male3")) voice = MALE3;
+    else if (!strcmp(str, "female1")) voice = FEMALE1;
+    else if (!strcmp(str, "female2")) voice = FEMALE2;
+    else if (!strcmp(str, "female3")) voice = FEMALE3;
+    else if (!strcmp(str, "child_male")) voice = CHILD_MALE;
+    else if (!strcmp(str, "child_female")) voice = CHILD_FEMALE;
+    else voice = NO_VOICE;
+
+    return voice;
+}
+
+char*
+EPunctMode2str(EPunctMode punct)
+{
+    char *str;
+
+    switch (punct)
+        {
+        case PUNCT_NONE: str = strdup("none"); break;
+        case PUNCT_ALL: str = strdup("all"); break;
+        case PUNCT_SOME: str = strdup("some"); break;
+        default: str = NULL;
+        }
+
+    return str;
+}
+
+EPunctMode
+str2EPunctMode(char* str)
+{
+    EPunctMode punct;
+
+    if (!strcmp(str, "none")) punct = PUNCT_NONE;
+    else if (!strcmp(str, "all")) punct = PUNCT_ALL;
+    else if (!strcmp(str, "some")) punct = PUNCT_SOME;
+    else punct = -1;
+
+    return punct;
+}
+
+char*
+ESpellMode2str(ESpellMode spell)
+{
+    char *str;
+
+    switch (spell)
+        {
+        case SPELLING_ON: str = strdup("on"); break;
+        case SPELLING_OFF: str = strdup("off"); break;
+        default: str = NULL;
+        }
+
+    return str;
+}
+
+ESpellMode
+str2ESpellMode(char* str)
+{
+    ESpellMode spell;
+
+    if (!strcmp(str, "on")) spell = SPELLING_ON;
+    else if (!strcmp(str, "off")) spell = SPELLING_OFF;
+    else spell = -1;
+
+    return spell;
+}
+
+char*
+ECapLetRecogn2str(ECapLetRecogn recogn)
+{
+    char *str;
+
+    switch (recogn)
+        {
+        case RECOGN_NONE: str = strdup("none"); break;
+        case RECOGN_SPELL: str = strdup("spell"); break;
+        case RECOGN_ICON: str = strdup("icon"); break;
+        default: str = NULL;
+        }
+
+    return str;
+}
+
+ECapLetRecogn
+str2ECapLetRecogn(char* str)
+{
+    ECapLetRecogn recogn;
+
+    if (!strcmp(str, "none")) recogn = RECOGN_NONE;
+    else if (!strcmp(str, "spell")) recogn = RECOGN_SPELL;
+    else if (!strcmp(str, "icon")) recogn = RECOGN_ICON;
+    else recogn = -1;
+
+    return recogn;
+}
+
+
+EVoiceType
+str2intpriority(char* str)
+{
+    int priority;
+
+    if (!strcmp(str, "important"))  priority = 1;
+    else if (!strcmp(str, "text")) priority = 2;
+    else if (!strcmp(str, "message")) priority = 3;
+    else if (!strcmp(str, "notification")) priority = 4;
+    else if (!strcmp(str, "progress")) priority = 5;
+    else priority = -1;
+
+    return priority;
+}
diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am
index dc93b1c..f411124 100644
--- a/src/modules/Makefile.am
+++ b/src/modules/Makefile.am
@@ -1,12 +1,12 @@
 localedir = $(datadir)/locale
-inc_local = "-I$(top_srcdir)/intl/"
+inc_local = "-I$(top_srcdir)/include/"
 
 SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
 SNDFILE_LIBS = @SNDFILE_LIBS@
 
 EXTRA_DIST = module_main.c module_utils_addvoice.c festival_client.c 
festival_client.h ivona_client.c dummy.c dummy-message.wav
 
-AM_CFLAGS = @ERROR_CFLAGS@ -DLOCALEDIR=\"$(localedir)\" 
-DDATADIR=\"$(snddatadir)\" -I/usr/include/ $(inc_local) @glib_include@ 
-L$(top_builddir)/src/audio -I$(top_srcdir)/src/audio -I../../intl/ 
$(ibmtts_include) @SNDFILE_CFLAGS@ -D_GNU_SOURCE
+AM_CFLAGS = @ERROR_CFLAGS@ -DLOCALEDIR=\"$(localedir)\" 
-DDATADIR=\"$(snddatadir)\" -I/usr/include/ $(inc_local) @glib_include@ 
-L$(top_builddir)/src/audio -I$(top_srcdir)/src/audio $(ibmtts_include) 
@SNDFILE_CFLAGS@ -D_GNU_SOURCE
 
 modulebin_PROGRAMS = sd_dummy sd_generic sd_festival sd_cicero
 
@@ -30,30 +30,30 @@ endif
 
 sd_flite_SOURCES = flite.c module_main.c module_utils.c module_utils.h
 sd_flite_LDFLAGS = @RPATH@ '$(spdlibdir)'
-sd_flite_LDADD = -lsdaudio $(flite_kal) $(flite_basic) -lpthread -ldotconf 
@glib_libs@ @gthread_libs@
+sd_flite_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio 
$(flite_kal) $(flite_basic) -lpthread -ldotconf @glib_libs@ @gthread_libs@
 
 sd_generic_SOURCES = generic.c module_main.c module_utils.c 
module_utils_addvoice.c module_utils.h
-sd_generic_LDADD = -lsdaudio -lpthread -ldotconf @glib_libs@ @gthread_libs@
+sd_generic_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio -lpthread 
-ldotconf @glib_libs@ @gthread_libs@
 
 sd_festival_SOURCES = festival.c festival_client.c festival_client.h 
module_main.c module_utils.c module_utils.h
 sd_festival_LDFLAGS = @RPATH@ '$(spdlibdir)'
-sd_festival_LDADD = -lsdaudio -lpthread -ldotconf @glib_libs@ @gthread_libs@ 
@EXTRA_SOCKET_LIBS@
+sd_festival_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio 
-lpthread -ldotconf @glib_libs@ @gthread_libs@ @EXTRA_SOCKET_LIBS@
 
 sd_ibmtts_SOURCES = ibmtts.c module_main.c module_utils.c 
module_utils_addvoice.c module_utils.h
 sd_ibmtts_LDFLAGS = @RPATH@ '$(spdlibdir)'
-sd_ibmtts_LDADD = -lsdaudio -lm -lpthread -ldotconf -libmeci @SNDFILE_LIBS@ 
@glib_libs@ @gthread_libs@
+sd_ibmtts_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio -lm 
-lpthread -ldotconf -libmeci @SNDFILE_LIBS@ @glib_libs@ @gthread_libs@
 
 sd_cicero_SOURCES = cicero.c module_main.c module_utils.c module_utils.h
-sd_cicero_LDADD = -lsdaudio -lpthread -ldotconf @glib_libs@ @gthread_libs@
+sd_cicero_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio -lpthread 
-ldotconf @glib_libs@ @gthread_libs@
 
 sd_espeak_SOURCES = espeak.c module_main.c module_utils.c module_utils.h
 sd_espeak_LDFLAGS = @RPATH@ '$(spdlibdir)'
-sd_espeak_LDADD = -lsdaudio -lespeak -ldotconf @glib_libs@ @SNDFILE_LIBS@ 
@gthread_libs@ @EXTRA_ESPEAK_LIBS@
+sd_espeak_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio -lespeak 
-ldotconf @glib_libs@ @SNDFILE_LIBS@ @gthread_libs@ @EXTRA_ESPEAK_LIBS@
 
 sd_ivona_SOURCES = ivona.c ivona_client.c ivona_client.h module_main.c 
module_utils.c module_utils.h
 sd_ivona_LDFLAGS = @RPATH@ '$(spdlibdir)'
-sd_ivona_LDADD = -lsdaudio -ldumbtts -lpthread -ldotconf @glib_libs@ 
@SNDFILE_LIBS@ @gthread_libs@
+sd_ivona_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio -ldumbtts 
-lpthread -ldotconf @glib_libs@ @SNDFILE_LIBS@ @gthread_libs@
 
 sd_dummy_SOURCES = dummy.c module_main.c module_utils.c 
module_utils_addvoice.c module_utils.h
 sd_dummy_LDFLAGS = @RPATH@ '$(spdlibdir)'
-sd_dummy_LDADD = -lsdaudio -lpthread -ldotconf @glib_libs@ @SNDFILE_LIBS@ 
@gthread_libs@
+sd_dummy_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio -lpthread 
-ldotconf @glib_libs@ @SNDFILE_LIBS@ @gthread_libs@
diff --git a/src/modules/cicero.c b/src/modules/cicero.c
index 2540abe..c01c022 100644
--- a/src/modules/cicero.c
+++ b/src/modules/cicero.c
@@ -21,7 +21,7 @@
  * @author: Olivier BERT
  */
 
-#include <fdset.h>
+#include <speechd_types.h>
 #include <errno.h>
 #include <sys/poll.h>
 #include <fcntl.h>
diff --git a/src/modules/dummy.c b/src/modules/dummy.c
index ea75d42..2815063 100644
--- a/src/modules/dummy.c
+++ b/src/modules/dummy.c
@@ -27,7 +27,7 @@
 
 #include <glib.h>
 
-#include "fdset.h"
+#include <speechd_types.h>
 
 #include "module_utils.h"
 
diff --git a/src/modules/espeak.c b/src/modules/espeak.c
index c96d757..040b06a 100644
--- a/src/modules/espeak.c
+++ b/src/modules/espeak.c
@@ -40,7 +40,7 @@
 /* Speech Dispatcher includes. */
 #include "config.h"
 #include "spd_audio.h"
-#include "fdset.h"
+#include <speechd_types.h>
 #include "module_utils.h"
 
 #if HAVE_SNDFILE
diff --git a/src/modules/festival.c b/src/modules/festival.c
index affef18..c1f655a 100644
--- a/src/modules/festival.c
+++ b/src/modules/festival.c
@@ -23,7 +23,7 @@
 
 #include <stdio.h>
 
-#include "fdset.h"
+#include <speechd_types.h>
 #include "fdsetconv.h"
 
 #include "festival_client.h"
diff --git a/src/modules/flite.c b/src/modules/flite.c
index bb052ea..dbd5662 100644
--- a/src/modules/flite.c
+++ b/src/modules/flite.c
@@ -29,7 +29,7 @@
 #include <flite/flite.h>
 #include "spd_audio.h"
 
-#include "fdset.h"
+#include <speechd_types.h>
 
 #include "module_utils.h"
 
diff --git a/src/modules/generic.c b/src/modules/generic.c
index 503966c..14dc01d 100644
--- a/src/modules/generic.c
+++ b/src/modules/generic.c
@@ -24,7 +24,7 @@
 
 #include <glib.h>
 
-#include "fdset.h"
+#include <speechd_types.h>
 
 #include "module_utils.h"
 
diff --git a/src/modules/ibmtts.c b/src/modules/ibmtts.c
index d5d8494..ae66720 100644
--- a/src/modules/ibmtts.c
+++ b/src/modules/ibmtts.c
@@ -57,7 +57,7 @@
 /* Speech Dispatcher includes. */
 #include "config.h"
 #include "spd_audio.h"
-#include "fdset.h"
+#include <speechd_types.h>
 #include "module_utils.h"
 
 #if HAVE_SNDFILE
diff --git a/src/modules/ivona.c b/src/modules/ivona.c
index e946463..0c3897f 100644
--- a/src/modules/ivona.c
+++ b/src/modules/ivona.c
@@ -29,7 +29,7 @@
 #include <libdumbtts.h>
 #include "spd_audio.h"
 
-#include "fdset.h"
+#include <speechd_types.h>
 
 #include "module_utils.h"
 #include "ivona_client.h"
diff --git a/src/modules/module_utils.c b/src/modules/module_utils.c
index b6d938f..bc32131 100644
--- a/src/modules/module_utils.c
+++ b/src/modules/module_utils.c
@@ -21,9 +21,7 @@
  * $Id: module_utils.c,v 1.55 2008-07-10 15:37:18 hanke Exp $
  */
 
-#include "fdsetconv.h"
-#include "fdsetconv.c"
-
+#include <fdsetconv.h>
 #include "module_utils.h"
 
 static char* module_audio_pars[10];
diff --git a/src/modules/module_utils.h b/src/modules/module_utils.h
index 9354ea8..bfdccde 100644
--- a/src/modules/module_utils.h
+++ b/src/modules/module_utils.h
@@ -44,14 +44,14 @@
 #include <sys/ipc.h>
 #include <sys/sem.h>
 
-#include "fdset.h"
+#include <speechd_types.h>
 #include "spd_audio.h"
 
 typedef struct{
     signed int rate;
     signed int pitch;
     signed int volume;
-    
+
     EPunctMode punctuation_mode;
     ESpellMode spelling_mode;
     ECapLetRecogn cap_let_recogn;
diff --git a/src/server/Makefile.am b/src/server/Makefile.am
index 0c56c68..fb90268 100644
--- a/src/server/Makefile.am
+++ b/src/server/Makefile.am
@@ -2,9 +2,9 @@
 bin_PROGRAMS = speech-dispatcher
 speech_dispatcher_SOURCES = speechd.c speechd.h server.c server.h history.c 
history.h module.c module.h config.c config.h parse.c parse.h set.c set.h msg.h 
alloc.c alloc.h compare.c compare.h speaking.c speaking.h options.c options.h 
output.c output.h sem_functions.c sem_functions.h index_marking.c 
index_marking.h
 
-speech_dispatcher_LDADD = -ldotconf -lglib-2.0 -lgmodule-2.0 @glib_libs@ 
@gthread_libs@ -lpthread @EXTRA_SOCKET_LIBS@
+speech_dispatcher_LDADD=$(top_builddir)/src/common/libcommon.la -ldotconf 
-lglib-2.0 -lgmodule-2.0 @glib_libs@ @gthread_libs@ -lpthread 
@EXTRA_SOCKET_LIBS@
 speech_dispatcher_LDFLAGS = @RDYNAMIC@
 
-inc_local = -I$(top_srcdir)/intl/
+inc_local = -I$(top_srcdir)/include/
 localedir = $(datadir)/locale
 AM_CFLAGS = @ERROR_CFLAGS@ $(inc_local) -I$(localedir) @glib_include@ 
-DSYS_CONF=\"@address@hidden" -DSND_DATA=\"@address@hidden" 
-DMODULEBINDIR=\"@address@hidden"  -DVERSION=\"@address@hidden" 
-DPACKAGE=\"@address@hidden" -D_GNU_SOURCE
diff --git a/src/server/config.c b/src/server/config.c
index 95bd75d..4fa0f10 100644
--- a/src/server/config.c
+++ b/src/server/config.c
@@ -26,7 +26,7 @@
 
 #include "speechd.h"
 #include "config.h"
-#include "fdsetconv.h"
+#include <fdsetconv.h>
 
 static TFDSetClientSpecific *cl_spec_section;
 
diff --git a/src/server/output.c b/src/server/output.c
index 0f15e87..a91e3b6 100644
--- a/src/server/output.c
+++ b/src/server/output.c
@@ -21,9 +21,8 @@
  * $Id: output.c,v 1.38 2008-06-27 12:28:48 hanke Exp $
  */
 
+#include <fdsetconv.h>
 #include "output.h"
-
-#include "fdsetconv.c"
 #include "parse.h"
 
 #ifdef TEMP_FAILURE_RETRY      /* GNU libc */
diff --git a/src/server/server.c b/src/server/server.c
index f28c38a..c341006 100644
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -40,7 +40,7 @@ int last_message_id = 0;
  *          case it means we are reloading the message and the
  *          behavior is slightly different
  *   history_flag -- should this message be included in history?
- *   type -- type of the message (see intl/fdset.h)
+ *   type -- type of the message (see ../../include/speechd_types.h)
  *   reparted -- if this is a preprocessed message reparted
  *             in more pieces
  * It returns 0 on success, -1 otherwise.
diff --git a/src/server/speaking.h b/src/server/speaking.h
index 12394b4..a0586f2 100644
--- a/src/server/speaking.h
+++ b/src/server/speaking.h
@@ -26,7 +26,7 @@
 #ifndef SPEAKING_H
 #define SPEAKING_H
 
-#include "fdset.h"
+#include <speechd_types.h>
 
 OutputModule *speaking_module;
 int speaking_uid;
diff --git a/src/server/speechd.h b/src/server/speechd.h
index f59bfda..f5424f9 100644
--- a/src/server/speechd.h
+++ b/src/server/speechd.h
@@ -68,7 +68,7 @@ union semun {
 };
 #endif
 
-#include "fdset.h"
+#include <speechd_types.h>
 #include "module.h"
 #include "compare.h"
 
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 7fdf847..314f423 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -1,6 +1,6 @@
 
 localedir = $(datadir)/locale
-inc_local = "-I$(top_srcdir)/intl/"
+inc_local = "-I$(top_srcdir)/include/"
 c_api = $(top_builddir)/src/c/api
 
 AM_CFLAGS = -I$(top_srcdir)/src/c/api -DLOCALEDIR=\"$(localedir)\" 
$(inc_local) @glib_include@ -I../audio/
-- 
1.7.2.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]