From 746824cc3ac28397a58be87f75a250dbfe95c53d Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 21 Jan 2003 09:38:59 +0000 Subject: [PATCH] r3831: *** empty log message *** --- wdq2wav.cpp | 10 +++------- wdq2wav.h | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/wdq2wav.cpp b/wdq2wav.cpp index 3fbe18f..5c18169 100644 --- a/wdq2wav.cpp +++ b/wdq2wav.cpp @@ -8,7 +8,7 @@ ** ** Copyright (c) 2003 Kevin Rosenberg ** -** $Id: wdq2wav.cpp,v 1.8 2003/01/21 07:37:13 kevin Exp $ +** $Id: wdq2wav.cpp,v 1.9 2003/01/21 09:38:59 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -38,14 +38,12 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: wdq2wav.cpp,v 1.8 2003/01/21 07:37:13 kevin Exp $"; +static const char* g_szIdStr = "$Id: wdq2wav.cpp,v 1.9 2003/01/21 09:38:59 kevin Exp $"; static bool g_quiet = false; static bool g_verbose = false; static bool g_debug = false; -#define MAX_INPUT_STR 256 - void error_msg (const char *msg) { @@ -103,7 +101,6 @@ usage (const char* progname) std::cout << " --help Print this help message\n"; } -bool wdq2wav (const char* wdq_fname, const int channel, const char *wav_fname); int main (int argc, char *argv[]) @@ -284,14 +281,13 @@ WindaqFile::ReadHeader () unsigned int tmp4; m_valid = false; - if ((m_fd = open (m_strFile.c_str(), O_RDONLY)) == 0) { + if ((m_fd = open (m_strFile.c_str(), O_RDONLY)) < 0) { m_error = "Unable to open file"; return false; } lseek (0, 0, SEEK_SET); if (read (m_fd, &tmp2, sizeof(tmp2)) != sizeof(tmp2)) { - m_error = "Unable to read beginning of file"; return false; } m_nChannels = tmp2 & 0x1f; diff --git a/wdq2wav.h b/wdq2wav.h index e4d261f..60b5dc5 100644 --- a/wdq2wav.h +++ b/wdq2wav.h @@ -8,7 +8,7 @@ ** ** Copyright (c) 2003 Kevin Rosenberg ** -** $Id: wdq2wav.h,v 1.5 2003/01/21 07:37:13 kevin Exp $ +** $Id: wdq2wav.h,v 1.6 2003/01/21 09:38:59 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -34,6 +34,19 @@ #include #include +extern const char* g_szIdStr; +extern bool g_quiet; +extern bool g_verbose; +extern bool g_debug; + +#define MAX_INPUT_STR 256 + +void error_msg (const char *msg); +void info_msg (const char *msg); +void info_msg_sans_newline (const char *msg); + +bool wdq2wav (const char* wdq_fname, const int channel, const char *wav_fname); + class WindaqFile { public: -- 2.34.1