speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH 4/6] move src/guile to src/api/guile


From: william hubbs
Subject: [PATCH 4/6] move src/guile to src/api/guile
Date: Wed, 15 Sep 2010 15:55:06 -0500

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

---
 src/Makefile.am            |    9 --
 src/api/Makefile.am        |    2 +-
 src/api/guile/ChangeLog    |   10 ++
 src/api/guile/Makefile     |   77 +++++++++++
 src/api/guile/README       |   12 ++
 src/api/guile/gssip.c      |  299 ++++++++++++++++++++++++++++++++++++++++++++
 src/api/guile/gssip.h      |   30 +++++
 src/api/guile/gssip.scm.in |   88 +++++++++++++
 src/guile/ChangeLog        |   10 --
 src/guile/Makefile         |   77 -----------
 src/guile/README           |   12 --
 src/guile/gssip.c          |  299 --------------------------------------------
 src/guile/gssip.h          |   30 -----
 src/guile/gssip.scm.in     |   88 -------------
 14 files changed, 517 insertions(+), 526 deletions(-)
 create mode 100644 src/api/guile/ChangeLog
 create mode 100644 src/api/guile/Makefile
 create mode 100644 src/api/guile/README
 create mode 100644 src/api/guile/gssip.c
 create mode 100644 src/api/guile/gssip.h
 create mode 100644 src/api/guile/gssip.scm.in
 delete mode 100644 src/guile/ChangeLog
 delete mode 100644 src/guile/Makefile
 delete mode 100644 src/guile/README
 delete mode 100644 src/guile/gssip.c
 delete mode 100644 src/guile/gssip.h
 delete mode 100644 src/guile/gssip.scm.in

diff --git a/src/Makefile.am b/src/Makefile.am
index 255f96c..edefd62 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,14 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-# APIs in languages other than C must be included here
-# (either directly listing all files or indirectly
-# in SUBDIRS if they contain another Makefile)
-# otherwise they won't be included in distribution packages
-
-EXTRA_DIST = \
-             guile/ChangeLog guile/Makefile guile/README guile/gssip.scm.in \
-             guile/gssip.c guile/gssip.h
-
 SUBDIRS=common server audio modules api clients tests
 
 if HAVE_PYTHON
diff --git a/src/api/Makefile.am b/src/api/Makefile.am
index 9653288..2a90e9e 100644
--- a/src/api/Makefile.am
+++ b/src/api/Makefile.am
@@ -2,5 +2,5 @@
 
 SUBDIRS= c
 
-EXTRA_DIST = cl
+EXTRA_DIST = cl guile
 
diff --git a/src/api/guile/ChangeLog b/src/api/guile/ChangeLog
new file mode 100644
index 0000000..487c157
--- /dev/null
+++ b/src/api/guile/ChangeLog
@@ -0,0 +1,10 @@
+2004-06-14  Milan Zamazal  <pdm at brailcom.org>
+
+       * gssip.scm.in (ssip-say-sound): Renamed to ssip-say-icon; C
+       function call fixed.
+
+2004-06-14  Milan Zamazal  <pdm at brailcom.org>
+
+       * gssip.scm.in (ssip-block): New argument priority; missing
+       argument in raw command invocations added.
+
diff --git a/src/api/guile/Makefile b/src/api/guile/Makefile
new file mode 100644
index 0000000..01b9775
--- /dev/null
+++ b/src/api/guile/Makefile
@@ -0,0 +1,77 @@
+# Makefile for speechd-guile
+
+# Copyright (C) 2004 Brailcom, o.p.s.
+#
+# Author: Milan Zamazal <pdm at brailcom.org>
+#
+# COPYRIGHT NOTICE
+#
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+
+
+prefix = /usr/local
+INSTALL_PATH = $(prefix)/share/guile/site
+
+CC = gcc
+CFLAGS = -g -Wall
+
+INSTALL_PROGRAM = install -m 755
+INSTALL_DATA = install -m 644
+
+PROGRAM = gssip
+
+.PHONY: all install install-strip uninstall clean distclean mostlyclean \
+       maintainer-clean TAGS info dvi dist check
+
+all: $(PROGRAM).so $(PROGRAM).scm
+
+$(PROGRAM).so: $(PROGRAM).c $(PROGRAM).x $(PROGRAM).h
+       $(CC) $(CFLAGS) -shared -fPIC -o $@ $(PROGRAM).c -lguile -lspeechd
+
+%.x: %.c
+       guile-snarf -o $@ $<
+
+%.scm: %.scm.in
+       sed 's/%%path%%/$(subst /,\/,$(INSTALL_PATH))/' $< > $@
+
+install: all
+       mkdir -p $(INSTALL_PATH)
+       $(INSTALL_PROGRAM) $(PROGRAM).so $(INSTALL_PATH)
+       $(INSTALL_DATA) $(PROGRAM).scm $(INSTALL_PATH)
+
+install-strip:
+       $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
+
+uninstall:
+
+mostlyclean:
+       rm -f *.scm *.so *.x
+
+clean: mostlyclean
+
+distclean: clean
+
+maintainer-clean: distclean
+
+TAGS:
+
+info:
+
+dvi:
+
+dist:
+
+check:
+
diff --git a/src/api/guile/README b/src/api/guile/README
new file mode 100644
index 0000000..9a4cc1c
--- /dev/null
+++ b/src/api/guile/README
@@ -0,0 +1,12 @@
+This is a Guile interface to SSIP.
+
+It is in an experimental state now and is expected to be significantly
+reworked before first official release.
+
+To compile it, run `make'.  libspeechd and guile libraries and headers files
+must be installed to get compiled the C part of the interface.
+
+If you have any questions, suggestions, etc., feel free to contact us at the
+mailing list <speechd at lists.freebsoft.org>.
+
+-- Milan Zamazal <pdm at freebsoft.org>
diff --git a/src/api/guile/gssip.c b/src/api/guile/gssip.c
new file mode 100644
index 0000000..a70ab8b
--- /dev/null
+++ b/src/api/guile/gssip.c
@@ -0,0 +1,299 @@
+/* SSIP Guile interface */
+
+/* Copyright (C) 2004 Brailcom, o.p.s.
+   
+   Author: Milan Zamazal <pdm at brailcom.org>
+
+   COPYRIGHT NOTICE
+
+   This program 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 program 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 program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+*/
+
+
+#define _GNU_SOURCE
+
+#include <stdio.h>
+#include <string.h>
+
+#include <libguile.h>
+#include <libspeechd.h>
+
+#include "gssip.h"
+
+
+#define ASSIGN_VAR(var, pos, checker, setter)                        \
+  SCM_ASSERT (SCM_##checker##P (var), var, SCM_ARG##pos, FUNC_NAME); \
+  c_##var = SCM_##setter (var)
+#define ASSIGN_INT(var, pos) ASSIGN_VAR (var, pos, INUM, INUM)
+#define ASSIGN_STRING(var, pos) ASSIGN_VAR (var, pos, STRING, STRING_CHARS)
+#define ASSIGN_SYMBOL(var, pos) ASSIGN_VAR (var, pos, SYMBOL, SYMBOL_CHARS)
+#define ASSIGN_CONNECTION() ASSIGN_INT (connection, 1);
+#define ASSIGN_PRIORITY() c_priority = assign_priority (priority, FUNC_NAME)
+
+#define RETURN_SUCCESS(value) return ((value) ? SCM_BOOL_F : SCM_BOOL_T)
+
+static SPDPriority assign_priority (SCM priority, const char *func_name)
+{
+  char *c_priority;
+  SCM_ASSERT (SCM_SYMBOLP (priority), priority, SCM_ARG3, func_name);
+  c_priority = SCM_SYMBOL_CHARS (priority);
+  
+  {
+    const int invalid_priority = -1000;
+    int int_priority =
+      ((! strcmp (c_priority, "important")) ? SPD_IMPORTANT
+       : (! strcmp (c_priority, "message")) ? SPD_MESSAGE
+       : (! strcmp (c_priority, "text")) ? SPD_TEXT
+       : (! strcmp (c_priority, "notification")) ? SPD_NOTIFICATION
+       : (! strcmp (c_priority, "progress")) ? SPD_PROGRESS
+       : invalid_priority);
+    if (int_priority == invalid_priority)
+      scm_wrong_type_arg (func_name, SCM_ARG3, priority);
+    return int_priority;
+  }
+}
+
+/* SSIP connection opening/closing functions */
+
+SCM_DEFINE (ssip_open, "%ssip-open", 3, 0, 0,
+            (SCM user, SCM client, SCM component),
+            "Open new SSIP connection and return its identifier.")
+#define FUNC_NAME s_ssip_open
+{
+  char *c_user, *c_client, *c_component;
+  ASSIGN_STRING (user, 1);
+  ASSIGN_STRING (client, 2);
+  ASSIGN_STRING (component, 3);
+
+  {
+    int connection = spd_open (c_client, c_component, c_user);
+    return (connection ? SCM_MAKINUM (connection) : SCM_EOL);
+  }
+}
+#undef FUNC_NAME
+
+SCM_DEFINE (ssip_close, "%ssip-close", 1, 0, 0, (SCM connection),
+            "Close the given SSIP connection.")
+#define FUNC_NAME s_ssip_close
+{
+  int c_connection;
+  ASSIGN_CONNECTION ();
+
+  spd_close (c_connection);
+
+  return SCM_UNSPECIFIED;
+}
+#undef FUNC_NAME
+
+/* Speech output functions */
+
+#define SSIP_OUTPUT_DECL(name, sname)                           \
+  SCM_DEFINE (ssip_say_##name, "%ssip-say-" sname, 3, 0, 0,     \
+              (SCM connection, SCM text, SCM priority),         \
+              "Say " sname " on CONNECTION with PRIORITY and return whether it 
succeeded.")
+#define SSIP_OUTPUT_BODY(spd_func)                                      \
+  {                                                                     \
+    int c_connection;                                                   \
+    char *c_text;                                                       \
+    SPDPriority c_priority;                                             \
+    ASSIGN_CONNECTION ();                                               \
+    ASSIGN_STRING (text, 2);                                            \
+    ASSIGN_PRIORITY ();                                                 \
+    RETURN_SUCCESS (spd_func (c_connection, c_priority, c_text));       \
+  }
+
+#define FUNC_NAME s_ssip_say_text
+SSIP_OUTPUT_DECL (text, "text")
+SSIP_OUTPUT_BODY (spd_say)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_say_character
+SSIP_OUTPUT_DECL (character, "character")
+SSIP_OUTPUT_BODY (spd_char)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_say_key
+SSIP_OUTPUT_DECL (key, "key")
+SSIP_OUTPUT_BODY (spd_key)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_say_icon
+SSIP_OUTPUT_DECL (icon, "icon")
+SSIP_OUTPUT_BODY (spd_sound_icon)
+#undef FUNC_NAME
+
+/* Speech output management functions */
+
+#define SSIP_CONTROL_DECL(name, sname)                  \
+  SCM_DEFINE (ssip_##name, "%ssip-" sname, 2, 0, 0,     \
+              (SCM connection, SCM id),                 \
+              sname "speaking and return whether it succeeded.")
+#define SSIP_CONTROL_BODY(name)                                         \
+  {                                                                     \
+    int c_connection;                                                   \
+    int result_code;                                                    \
+    ASSIGN_CONNECTION ();                                               \
+    if (SCM_INUMP (id))                                                 \
+      result_code = spd_stop_uid (c_connection, SCM_INUM (id));         \
+    else if (id == SCM_EOL)                                             \
+      result_code = spd_stop (c_connection);                            \
+    else if (SCM_SYMBOLP (id)                                           \
+             && (! strcmp (SCM_SYMBOL_CHARS (id), "t")))                \
+      result_code = spd_stop_all (c_connection);                        \
+    else                                                                \
+      scm_wrong_type_arg (FUNC_NAME, SCM_ARG2, id);                     \
+    RETURN_SUCCESS (result_code);                                       \
+  }
+  
+#define FUNC_NAME s_ssip_stop
+SSIP_CONTROL_DECL (stop, "stop")
+SSIP_CONTROL_BODY (stop)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_cancel
+SSIP_CONTROL_DECL (cancel, "cancel")
+SSIP_CONTROL_BODY (cancel)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_pause
+SSIP_CONTROL_DECL (pause, "pause")
+SSIP_CONTROL_BODY (pause)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_resume
+SSIP_CONTROL_DECL (resume, "resume")
+SSIP_CONTROL_BODY (resume)
+#undef FUNC_NAME
+
+/* Speech parameters functions */
+
+#define SSIP_SET_DECL(name, sname)                              \
+  SCM_DEFINE (ssip_set_##name, "%ssip-set-" sname, 2, 0, 0,     \
+              (SCM connection, SCM value),                      \
+              "Set " sname " for CONNECTION.")
+
+#define SSIP_PROCESS_SET_ARGS(type, type_f)     \
+  int c_connection;                             \
+  type c_value;                                 \
+  ASSIGN_CONNECTION ();                         \
+  ASSIGN_##type_f (value, 2);
+
+#define SSIP_SET_STRING_BODY(name)                                      \
+  {                                                                     \
+    SSIP_PROCESS_SET_ARGS (char *, STRING);                             \
+    RETURN_SUCCESS (spd_set_##name (c_connection, c_value));            \
+  }
+
+#define SSIP_SET_INT_BODY(name)                                         \
+  {                                                                     \
+    SSIP_PROCESS_SET_ARGS (int, INT);                                   \
+    SCM_ASSERT ((-100 <= c_value && c_value <= 100), value, SCM_ARG2,   \
+                FUNC_NAME);                                             \
+    RETURN_SUCCESS (spd_set_##name (c_connection, c_value));            \
+  }
+
+#define FUNC_NAME s_ssip_set_language
+SSIP_SET_DECL (language, "language")
+SSIP_SET_STRING_BODY (language)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_set_output_module
+SSIP_SET_DECL (output_module, "output-module")
+SSIP_SET_STRING_BODY (output_module)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_set_rate
+SSIP_SET_DECL (rate, "rate")
+SSIP_SET_INT_BODY (voice_rate)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_set_pitch
+SSIP_SET_DECL (pitch, "pitch")
+SSIP_SET_INT_BODY (voice_pitch)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_set_volume
+SSIP_SET_DECL (volume, "volume")
+SSIP_SET_INT_BODY (volume)
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_set_voice
+SSIP_SET_DECL (voice, "voice")
+{
+  SSIP_PROCESS_SET_ARGS (char *, STRING);
+  {
+    char *command;
+    int result_code;
+
+    if (asprintf (&command, "SET self VOICE %s", c_value) < 0)
+      scm_memory_error (FUNC_NAME);
+    result_code = spd_execute_command (c_connection, command);
+    free (command);
+    RETURN_SUCCESS (result_code);
+  }
+}
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_set_punctuation_mode
+SSIP_SET_DECL (punctuation_mode, "punctuation-mode")
+{
+  SSIP_PROCESS_SET_ARGS (char *, SYMBOL);
+  {
+    SPDPunctuation mode;
+    if (! strcmp (c_value, "none")) mode = SPD_PUNCT_NONE;
+    else if (! strcmp (c_value, "some")) mode = SPD_PUNCT_SOME;
+    else if (! strcmp (c_value, "all")) mode = SPD_PUNCT_ALL;
+    else scm_wrong_type_arg (FUNC_NAME, SCM_ARG2, value);
+    RETURN_SUCCESS (spd_set_punctuation (c_connection, mode));
+  }
+}
+#undef FUNC_NAME
+
+#define FUNC_NAME s_ssip_set_spelling_mode
+SSIP_SET_DECL (spelling_mode, "spelling-mode")
+{
+  SSIP_PROCESS_SET_ARGS (char *, SYMBOL);
+  {
+    SPDSpelling mode;
+    if (! strcmp (c_value, "on")) mode = SPD_SPELL_ON;
+    else if (! strcmp (c_value, "off")) mode = SPD_SPELL_OFF;
+    else scm_wrong_type_arg (FUNC_NAME, SCM_ARG2, value);
+    RETURN_SUCCESS (spd_set_spelling (c_connection, mode));
+  }
+}
+#undef FUNC_NAME
+
+/* Raw SSIP commands */
+
+SCM_DEFINE (ssip_raw_command, "%ssip-raw-command", 2, 0, 0,
+            (SCM connection, SCM command),
+            "Send raw COMMAND to CONNECTION and return whether it succeeded.")
+#define FUNC_NAME s_ssip_raw_command
+{
+  int c_connection;
+  char *c_command;
+  ASSIGN_CONNECTION ();
+  ASSIGN_STRING (command, 2);
+
+  RETURN_SUCCESS (spd_execute_command (c_connection, c_command));
+}
+#undef FUNC_NAME
+
+/* Define the Scheme bindings */
+
+void init_gssip ()
+{
+#include "gssip.x"
+}
diff --git a/src/api/guile/gssip.h b/src/api/guile/gssip.h
new file mode 100644
index 0000000..b03e08a
--- /dev/null
+++ b/src/api/guile/gssip.h
@@ -0,0 +1,30 @@
+/* SSIP Guile support */
+
+/* Copyright (C) 2004 Brailcom, o.p.s.
+
+   Author: Milan Zamazal <pdm at brailcom.org>
+
+   COPYRIGHT NOTICE
+
+   This program 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, version 2 of the License.
+
+   This program 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 program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+*/
+
+
+#ifndef __GSSIP_H
+
+#define __GSSIP_H
+
+void init_gssip ();
+
+#endif
diff --git a/src/api/guile/gssip.scm.in b/src/api/guile/gssip.scm.in
new file mode 100644
index 0000000..e1df3b8
--- /dev/null
+++ b/src/api/guile/gssip.scm.in
@@ -0,0 +1,88 @@
+;;; SSIP interface
+
+;; Copyright (C) 2004 Brailcom, o.p.s.
+
+;; Author: Milan Zamazal <pdm at brailcom.org>
+
+;; COPYRIGHT NOTICE
+
+;; This program 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 of the License, or
+;; (at your option) any later version.
+
+;; This program 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 program; if not, write to the Free Software
+;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+
+
+(load-extension "%%path%%/gssip" "init_gssip")
+
+
+(define (ssip-open host port user client component)
+  (%ssip-open user client component))
+
+(define (ssip-close connection)
+  (%ssip-close connection))
+
+(define (ssip-say-text connection text priority)
+  (%ssip-say-text connection text priority))
+
+(define (ssip-say-character connection character priority)
+  (%ssip-say-character connection character priority))
+
+(define (ssip-say-key connection key priority)
+  (%ssip-say-key connection key priority))
+
+(define (ssip-say-icon connection sound priority)
+  (%ssip-say-icon connection sound priority))
+
+(define (ssip-stop connection id)
+  (%ssip-stop connection id))
+
+(define (ssip-cancel connection id)
+  (%ssip-cancel connection id))
+
+(define (ssip-pause connection id)
+  (%ssip-pause connection id))
+
+(define (ssip-resume connection id)
+  (%ssip-resume connection id))
+
+(define (ssip-set-language connection language)
+  (%ssip-set-language connection language))
+
+(define (ssip-set-output-module connection output-module)
+  (%ssip-set-output-module connection output-module))
+
+(define (ssip-set-rate connection rate)
+  (%ssip-set-rate connection rate))
+
+(define (ssip-set-pitch connection pitch)
+  (%ssip-set-pitch connection pitch))
+
+(define (ssip-set-volume connection volume)
+  (%ssip-set-volume connection volume))
+
+(define (ssip-set-voice connection voice)
+  (%ssip-set-voice connection voice))
+
+(define (ssip-set-punctuation-mode connection mode)
+  (%ssip-set-punctuation-mode connection mode))
+
+(define (ssip-set-spelling-mode connection mode)
+  (%ssip-set-spelling-mode connection mode))
+
+(define (ssip-block connection priority function)
+  (%ssip-say-text connection "" priority)
+  (%ssip-raw-command connection "BLOCK BEGIN")
+  (catch #t (function) (lambda (key . args)))
+  (%ssip-raw-command connection "BLOCK END"))
+
+
+(provide 'gssip)
diff --git a/src/guile/ChangeLog b/src/guile/ChangeLog
deleted file mode 100644
index 487c157..0000000
--- a/src/guile/ChangeLog
+++ /dev/null
@@ -1,10 +0,0 @@
-2004-06-14  Milan Zamazal  <pdm at brailcom.org>
-
-       * gssip.scm.in (ssip-say-sound): Renamed to ssip-say-icon; C
-       function call fixed.
-
-2004-06-14  Milan Zamazal  <pdm at brailcom.org>
-
-       * gssip.scm.in (ssip-block): New argument priority; missing
-       argument in raw command invocations added.
-
diff --git a/src/guile/Makefile b/src/guile/Makefile
deleted file mode 100644
index 01b9775..0000000
--- a/src/guile/Makefile
+++ /dev/null
@@ -1,77 +0,0 @@
-# Makefile for speechd-guile
-
-# Copyright (C) 2004 Brailcom, o.p.s.
-#
-# Author: Milan Zamazal <pdm at brailcom.org>
-#
-# COPYRIGHT NOTICE
-#
-# This program 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 of the License, or
-# (at your option) any later version.
-#
-# This program 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 program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
-
-
-prefix = /usr/local
-INSTALL_PATH = $(prefix)/share/guile/site
-
-CC = gcc
-CFLAGS = -g -Wall
-
-INSTALL_PROGRAM = install -m 755
-INSTALL_DATA = install -m 644
-
-PROGRAM = gssip
-
-.PHONY: all install install-strip uninstall clean distclean mostlyclean \
-       maintainer-clean TAGS info dvi dist check
-
-all: $(PROGRAM).so $(PROGRAM).scm
-
-$(PROGRAM).so: $(PROGRAM).c $(PROGRAM).x $(PROGRAM).h
-       $(CC) $(CFLAGS) -shared -fPIC -o $@ $(PROGRAM).c -lguile -lspeechd
-
-%.x: %.c
-       guile-snarf -o $@ $<
-
-%.scm: %.scm.in
-       sed 's/%%path%%/$(subst /,\/,$(INSTALL_PATH))/' $< > $@
-
-install: all
-       mkdir -p $(INSTALL_PATH)
-       $(INSTALL_PROGRAM) $(PROGRAM).so $(INSTALL_PATH)
-       $(INSTALL_DATA) $(PROGRAM).scm $(INSTALL_PATH)
-
-install-strip:
-       $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
-
-uninstall:
-
-mostlyclean:
-       rm -f *.scm *.so *.x
-
-clean: mostlyclean
-
-distclean: clean
-
-maintainer-clean: distclean
-
-TAGS:
-
-info:
-
-dvi:
-
-dist:
-
-check:
-
diff --git a/src/guile/README b/src/guile/README
deleted file mode 100644
index 9a4cc1c..0000000
--- a/src/guile/README
+++ /dev/null
@@ -1,12 +0,0 @@
-This is a Guile interface to SSIP.
-
-It is in an experimental state now and is expected to be significantly
-reworked before first official release.
-
-To compile it, run `make'.  libspeechd and guile libraries and headers files
-must be installed to get compiled the C part of the interface.
-
-If you have any questions, suggestions, etc., feel free to contact us at the
-mailing list <speechd at lists.freebsoft.org>.
-
--- Milan Zamazal <pdm at freebsoft.org>
diff --git a/src/guile/gssip.c b/src/guile/gssip.c
deleted file mode 100644
index a70ab8b..0000000
--- a/src/guile/gssip.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/* SSIP Guile interface */
-
-/* Copyright (C) 2004 Brailcom, o.p.s.
-   
-   Author: Milan Zamazal <pdm at brailcom.org>
-
-   COPYRIGHT NOTICE
-
-   This program 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 program 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 program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
-*/
-
-
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <string.h>
-
-#include <libguile.h>
-#include <libspeechd.h>
-
-#include "gssip.h"
-
-
-#define ASSIGN_VAR(var, pos, checker, setter)                        \
-  SCM_ASSERT (SCM_##checker##P (var), var, SCM_ARG##pos, FUNC_NAME); \
-  c_##var = SCM_##setter (var)
-#define ASSIGN_INT(var, pos) ASSIGN_VAR (var, pos, INUM, INUM)
-#define ASSIGN_STRING(var, pos) ASSIGN_VAR (var, pos, STRING, STRING_CHARS)
-#define ASSIGN_SYMBOL(var, pos) ASSIGN_VAR (var, pos, SYMBOL, SYMBOL_CHARS)
-#define ASSIGN_CONNECTION() ASSIGN_INT (connection, 1);
-#define ASSIGN_PRIORITY() c_priority = assign_priority (priority, FUNC_NAME)
-
-#define RETURN_SUCCESS(value) return ((value) ? SCM_BOOL_F : SCM_BOOL_T)
-
-static SPDPriority assign_priority (SCM priority, const char *func_name)
-{
-  char *c_priority;
-  SCM_ASSERT (SCM_SYMBOLP (priority), priority, SCM_ARG3, func_name);
-  c_priority = SCM_SYMBOL_CHARS (priority);
-  
-  {
-    const int invalid_priority = -1000;
-    int int_priority =
-      ((! strcmp (c_priority, "important")) ? SPD_IMPORTANT
-       : (! strcmp (c_priority, "message")) ? SPD_MESSAGE
-       : (! strcmp (c_priority, "text")) ? SPD_TEXT
-       : (! strcmp (c_priority, "notification")) ? SPD_NOTIFICATION
-       : (! strcmp (c_priority, "progress")) ? SPD_PROGRESS
-       : invalid_priority);
-    if (int_priority == invalid_priority)
-      scm_wrong_type_arg (func_name, SCM_ARG3, priority);
-    return int_priority;
-  }
-}
-
-/* SSIP connection opening/closing functions */
-
-SCM_DEFINE (ssip_open, "%ssip-open", 3, 0, 0,
-            (SCM user, SCM client, SCM component),
-            "Open new SSIP connection and return its identifier.")
-#define FUNC_NAME s_ssip_open
-{
-  char *c_user, *c_client, *c_component;
-  ASSIGN_STRING (user, 1);
-  ASSIGN_STRING (client, 2);
-  ASSIGN_STRING (component, 3);
-
-  {
-    int connection = spd_open (c_client, c_component, c_user);
-    return (connection ? SCM_MAKINUM (connection) : SCM_EOL);
-  }
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (ssip_close, "%ssip-close", 1, 0, 0, (SCM connection),
-            "Close the given SSIP connection.")
-#define FUNC_NAME s_ssip_close
-{
-  int c_connection;
-  ASSIGN_CONNECTION ();
-
-  spd_close (c_connection);
-
-  return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-/* Speech output functions */
-
-#define SSIP_OUTPUT_DECL(name, sname)                           \
-  SCM_DEFINE (ssip_say_##name, "%ssip-say-" sname, 3, 0, 0,     \
-              (SCM connection, SCM text, SCM priority),         \
-              "Say " sname " on CONNECTION with PRIORITY and return whether it 
succeeded.")
-#define SSIP_OUTPUT_BODY(spd_func)                                      \
-  {                                                                     \
-    int c_connection;                                                   \
-    char *c_text;                                                       \
-    SPDPriority c_priority;                                             \
-    ASSIGN_CONNECTION ();                                               \
-    ASSIGN_STRING (text, 2);                                            \
-    ASSIGN_PRIORITY ();                                                 \
-    RETURN_SUCCESS (spd_func (c_connection, c_priority, c_text));       \
-  }
-
-#define FUNC_NAME s_ssip_say_text
-SSIP_OUTPUT_DECL (text, "text")
-SSIP_OUTPUT_BODY (spd_say)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_say_character
-SSIP_OUTPUT_DECL (character, "character")
-SSIP_OUTPUT_BODY (spd_char)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_say_key
-SSIP_OUTPUT_DECL (key, "key")
-SSIP_OUTPUT_BODY (spd_key)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_say_icon
-SSIP_OUTPUT_DECL (icon, "icon")
-SSIP_OUTPUT_BODY (spd_sound_icon)
-#undef FUNC_NAME
-
-/* Speech output management functions */
-
-#define SSIP_CONTROL_DECL(name, sname)                  \
-  SCM_DEFINE (ssip_##name, "%ssip-" sname, 2, 0, 0,     \
-              (SCM connection, SCM id),                 \
-              sname "speaking and return whether it succeeded.")
-#define SSIP_CONTROL_BODY(name)                                         \
-  {                                                                     \
-    int c_connection;                                                   \
-    int result_code;                                                    \
-    ASSIGN_CONNECTION ();                                               \
-    if (SCM_INUMP (id))                                                 \
-      result_code = spd_stop_uid (c_connection, SCM_INUM (id));         \
-    else if (id == SCM_EOL)                                             \
-      result_code = spd_stop (c_connection);                            \
-    else if (SCM_SYMBOLP (id)                                           \
-             && (! strcmp (SCM_SYMBOL_CHARS (id), "t")))                \
-      result_code = spd_stop_all (c_connection);                        \
-    else                                                                \
-      scm_wrong_type_arg (FUNC_NAME, SCM_ARG2, id);                     \
-    RETURN_SUCCESS (result_code);                                       \
-  }
-  
-#define FUNC_NAME s_ssip_stop
-SSIP_CONTROL_DECL (stop, "stop")
-SSIP_CONTROL_BODY (stop)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_cancel
-SSIP_CONTROL_DECL (cancel, "cancel")
-SSIP_CONTROL_BODY (cancel)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_pause
-SSIP_CONTROL_DECL (pause, "pause")
-SSIP_CONTROL_BODY (pause)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_resume
-SSIP_CONTROL_DECL (resume, "resume")
-SSIP_CONTROL_BODY (resume)
-#undef FUNC_NAME
-
-/* Speech parameters functions */
-
-#define SSIP_SET_DECL(name, sname)                              \
-  SCM_DEFINE (ssip_set_##name, "%ssip-set-" sname, 2, 0, 0,     \
-              (SCM connection, SCM value),                      \
-              "Set " sname " for CONNECTION.")
-
-#define SSIP_PROCESS_SET_ARGS(type, type_f)     \
-  int c_connection;                             \
-  type c_value;                                 \
-  ASSIGN_CONNECTION ();                         \
-  ASSIGN_##type_f (value, 2);
-
-#define SSIP_SET_STRING_BODY(name)                                      \
-  {                                                                     \
-    SSIP_PROCESS_SET_ARGS (char *, STRING);                             \
-    RETURN_SUCCESS (spd_set_##name (c_connection, c_value));            \
-  }
-
-#define SSIP_SET_INT_BODY(name)                                         \
-  {                                                                     \
-    SSIP_PROCESS_SET_ARGS (int, INT);                                   \
-    SCM_ASSERT ((-100 <= c_value && c_value <= 100), value, SCM_ARG2,   \
-                FUNC_NAME);                                             \
-    RETURN_SUCCESS (spd_set_##name (c_connection, c_value));            \
-  }
-
-#define FUNC_NAME s_ssip_set_language
-SSIP_SET_DECL (language, "language")
-SSIP_SET_STRING_BODY (language)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_set_output_module
-SSIP_SET_DECL (output_module, "output-module")
-SSIP_SET_STRING_BODY (output_module)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_set_rate
-SSIP_SET_DECL (rate, "rate")
-SSIP_SET_INT_BODY (voice_rate)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_set_pitch
-SSIP_SET_DECL (pitch, "pitch")
-SSIP_SET_INT_BODY (voice_pitch)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_set_volume
-SSIP_SET_DECL (volume, "volume")
-SSIP_SET_INT_BODY (volume)
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_set_voice
-SSIP_SET_DECL (voice, "voice")
-{
-  SSIP_PROCESS_SET_ARGS (char *, STRING);
-  {
-    char *command;
-    int result_code;
-
-    if (asprintf (&command, "SET self VOICE %s", c_value) < 0)
-      scm_memory_error (FUNC_NAME);
-    result_code = spd_execute_command (c_connection, command);
-    free (command);
-    RETURN_SUCCESS (result_code);
-  }
-}
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_set_punctuation_mode
-SSIP_SET_DECL (punctuation_mode, "punctuation-mode")
-{
-  SSIP_PROCESS_SET_ARGS (char *, SYMBOL);
-  {
-    SPDPunctuation mode;
-    if (! strcmp (c_value, "none")) mode = SPD_PUNCT_NONE;
-    else if (! strcmp (c_value, "some")) mode = SPD_PUNCT_SOME;
-    else if (! strcmp (c_value, "all")) mode = SPD_PUNCT_ALL;
-    else scm_wrong_type_arg (FUNC_NAME, SCM_ARG2, value);
-    RETURN_SUCCESS (spd_set_punctuation (c_connection, mode));
-  }
-}
-#undef FUNC_NAME
-
-#define FUNC_NAME s_ssip_set_spelling_mode
-SSIP_SET_DECL (spelling_mode, "spelling-mode")
-{
-  SSIP_PROCESS_SET_ARGS (char *, SYMBOL);
-  {
-    SPDSpelling mode;
-    if (! strcmp (c_value, "on")) mode = SPD_SPELL_ON;
-    else if (! strcmp (c_value, "off")) mode = SPD_SPELL_OFF;
-    else scm_wrong_type_arg (FUNC_NAME, SCM_ARG2, value);
-    RETURN_SUCCESS (spd_set_spelling (c_connection, mode));
-  }
-}
-#undef FUNC_NAME
-
-/* Raw SSIP commands */
-
-SCM_DEFINE (ssip_raw_command, "%ssip-raw-command", 2, 0, 0,
-            (SCM connection, SCM command),
-            "Send raw COMMAND to CONNECTION and return whether it succeeded.")
-#define FUNC_NAME s_ssip_raw_command
-{
-  int c_connection;
-  char *c_command;
-  ASSIGN_CONNECTION ();
-  ASSIGN_STRING (command, 2);
-
-  RETURN_SUCCESS (spd_execute_command (c_connection, c_command));
-}
-#undef FUNC_NAME
-
-/* Define the Scheme bindings */
-
-void init_gssip ()
-{
-#include "gssip.x"
-}
diff --git a/src/guile/gssip.h b/src/guile/gssip.h
deleted file mode 100644
index b03e08a..0000000
--- a/src/guile/gssip.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* SSIP Guile support */
-
-/* Copyright (C) 2004 Brailcom, o.p.s.
-
-   Author: Milan Zamazal <pdm at brailcom.org>
-
-   COPYRIGHT NOTICE
-
-   This program 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, version 2 of the License.
-
-   This program 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 program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
-*/
-
-
-#ifndef __GSSIP_H
-
-#define __GSSIP_H
-
-void init_gssip ();
-
-#endif
diff --git a/src/guile/gssip.scm.in b/src/guile/gssip.scm.in
deleted file mode 100644
index e1df3b8..0000000
--- a/src/guile/gssip.scm.in
+++ /dev/null
@@ -1,88 +0,0 @@
-;;; SSIP interface
-
-;; Copyright (C) 2004 Brailcom, o.p.s.
-
-;; Author: Milan Zamazal <pdm at brailcom.org>
-
-;; COPYRIGHT NOTICE
-
-;; This program 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 of the License, or
-;; (at your option) any later version.
-
-;; This program 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 program; if not, write to the Free Software
-;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
-
-
-(load-extension "%%path%%/gssip" "init_gssip")
-
-
-(define (ssip-open host port user client component)
-  (%ssip-open user client component))
-
-(define (ssip-close connection)
-  (%ssip-close connection))
-
-(define (ssip-say-text connection text priority)
-  (%ssip-say-text connection text priority))
-
-(define (ssip-say-character connection character priority)
-  (%ssip-say-character connection character priority))
-
-(define (ssip-say-key connection key priority)
-  (%ssip-say-key connection key priority))
-
-(define (ssip-say-icon connection sound priority)
-  (%ssip-say-icon connection sound priority))
-
-(define (ssip-stop connection id)
-  (%ssip-stop connection id))
-
-(define (ssip-cancel connection id)
-  (%ssip-cancel connection id))
-
-(define (ssip-pause connection id)
-  (%ssip-pause connection id))
-
-(define (ssip-resume connection id)
-  (%ssip-resume connection id))
-
-(define (ssip-set-language connection language)
-  (%ssip-set-language connection language))
-
-(define (ssip-set-output-module connection output-module)
-  (%ssip-set-output-module connection output-module))
-
-(define (ssip-set-rate connection rate)
-  (%ssip-set-rate connection rate))
-
-(define (ssip-set-pitch connection pitch)
-  (%ssip-set-pitch connection pitch))
-
-(define (ssip-set-volume connection volume)
-  (%ssip-set-volume connection volume))
-
-(define (ssip-set-voice connection voice)
-  (%ssip-set-voice connection voice))
-
-(define (ssip-set-punctuation-mode connection mode)
-  (%ssip-set-punctuation-mode connection mode))
-
-(define (ssip-set-spelling-mode connection mode)
-  (%ssip-set-spelling-mode connection mode))
-
-(define (ssip-block connection priority function)
-  (%ssip-say-text connection "" priority)
-  (%ssip-raw-command connection "BLOCK BEGIN")
-  (catch #t (function) (lambda (key . args)))
-  (%ssip-raw-command connection "BLOCK END"))
-
-
-(provide 'gssip)
-- 
1.7.2.2




reply via email to

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