[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/4] remove def.h
From: |
william hubbs |
Subject: |
[PATCH 1/4] remove def.h |
Date: |
Mon, 13 Sep 2010 17:47:40 -0500 |
From: William Hubbs <address@hidden>
To: address@hidden
To paraphrase a statement from Hynek: The server's configuration
options should be in the server code, and the client libraries should do
the right thing, independently, based on the documentation.
---
intl/def.h | 34 ----------------------------------
src/c/api/libspeechd.c | 1 -
src/c/api/libspeechd.h | 2 ++
src/server/config.h | 2 ++
src/server/speechd.h | 3 ++-
src/tests/clibrary.c | 1 -
src/tests/clibrary2.c | 1 -
src/tests/long_message.c | 1 -
src/tests/run_test.c | 1 -
9 files changed, 6 insertions(+), 40 deletions(-)
delete mode 100644 intl/def.h
diff --git a/intl/def.h b/intl/def.h
deleted file mode 100644
index cffde7c..0000000
--- a/intl/def.h
+++ /dev/null
@@ -1,34 +0,0 @@
-
-/*
- * def.h - Some global definitions 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: def.h,v 1.19 2006-07-11 16:12:26 hanke Exp $
- */
-
-/* some constants common for speech server and client part */
-
-#ifndef SPEECHD_DEF_I
- #define SPEECHD_DEF_I
-
-#define SPEECHD_DEFAULT_PORT 6560
-
-#define SPEECHD_DEBUG 0
-
-#endif
diff --git a/src/c/api/libspeechd.c b/src/c/api/libspeechd.c
index ede727c..7ef94c2 100644
--- a/src/c/api/libspeechd.c
+++ b/src/c/api/libspeechd.c
@@ -42,7 +42,6 @@
#include <assert.h>
#include <netdb.h>
-#include "def.h"
#include "libspeechd.h"
/* Comment/uncomment to switch debugging on/off */
diff --git a/src/c/api/libspeechd.h b/src/c/api/libspeechd.h
index 8692540..c88f89f 100644
--- a/src/c/api/libspeechd.h
+++ b/src/c/api/libspeechd.h
@@ -40,6 +40,8 @@ FILE* spd_debug;
/* Unless there is an fatal error, it doesn't print anything */
#define SPD_FATAL(msg) { printf("Fatal error (libspeechd) [%s:%d]:"msg,
__FILE__, __LINE__); fflush(stdout); exit(EXIT_FAILURE); }
+/* Speech Dispatcher's default port for inet communication */
+#define SPEECHD_DEFAULT_PORT 6560
/* Arguments for spd_send_data() */
#define SPD_WAIT_REPLY 1 /* Wait for reply */
diff --git a/src/server/config.h b/src/server/config.h
index 28854d1..84f6989 100644
--- a/src/server/config.h
+++ b/src/server/config.h
@@ -28,6 +28,8 @@
#include <stdlib.h>
#include <dotconf.h>
+#define SPEECHD_DEFAULT_PORT 6560
+
/* Loading options from DotConf */
configoption_t *spd_options;
int spd_num_options;
diff --git a/src/server/speechd.h b/src/server/speechd.h
index fbfc65e..f1a2525 100644
--- a/src/server/speechd.h
+++ b/src/server/speechd.h
@@ -50,6 +50,8 @@
#include <sys/ipc.h>
#include <sys/sem.h>
+#define SPEECHD_DEBUG 0
+
/* Definition of semun needed for semaphore manipulation */
/* TODO: This fixes compilation for Mac OS X but might not be a correct
solution for other platforms. A better check is needed, possibly including
@@ -66,7 +68,6 @@ union semun {
};
#endif
-#include "def.h"
#include "fdset.h"
#include "module.h"
#include "compare.h"
diff --git a/src/tests/clibrary.c b/src/tests/clibrary.c
index f01c774..ec2d14c 100644
--- a/src/tests/clibrary.c
+++ b/src/tests/clibrary.c
@@ -27,7 +27,6 @@
#include <unistd.h>
#include "libspeechd.h"
-#include "def.h"
int main() {
SPDConnection* conn;
diff --git a/src/tests/clibrary2.c b/src/tests/clibrary2.c
index 7ba410b..4847a04 100644
--- a/src/tests/clibrary2.c
+++ b/src/tests/clibrary2.c
@@ -27,7 +27,6 @@
#include <unistd.h>
#include "libspeechd.h"
-#include "def.h"
int main() {
SPDConnection* conn;
diff --git a/src/tests/long_message.c b/src/tests/long_message.c
index 41d9e48..6610e7f 100644
--- a/src/tests/long_message.c
+++ b/src/tests/long_message.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include "libspeechd.h"
-#include "def.h"
int main() {
SPDConnection *sockfd;
diff --git a/src/tests/run_test.c b/src/tests/run_test.c
index f2e87fa..e5f99c8 100644
--- a/src/tests/run_test.c
+++ b/src/tests/run_test.c
@@ -34,7 +34,6 @@
#include <ctype.h>
#include <errno.h>
-#include "def.h"
#define FATAL(msg) { printf(msg"\n"); exit(1); }
--
1.7.2.2
- [PATCH 1/4] remove def.h,
william hubbs <=