r3831: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 21 Jan 2003 09:38:59 +0000 (09:38 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 21 Jan 2003 09:38:59 +0000 (09:38 +0000)
wdq2wav.cpp
wdq2wav.h

index 3fbe18f75723b0a175ba35c467db5d4b118c5a36..5c1816913d66dbff48c35107d5fae7b7ca818954 100644 (file)
@@ -8,7 +8,7 @@
 **
 **  Copyright (c) 2003 Kevin Rosenberg
 **
 **
 **  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
 **
 **  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}
 };
 
   {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;
 
 
 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)
 {
 void
 error_msg (const char *msg)
 {
@@ -103,7 +101,6 @@ usage (const char* progname)
   std::cout << "     --help      Print this help message\n";
 }
 
   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[])
 
 int
 main (int argc, char *argv[])
@@ -284,14 +281,13 @@ WindaqFile::ReadHeader ()
   unsigned int tmp4;
 
   m_valid = false;
   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 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;
     return false;
   }
   m_nChannels = tmp2 & 0x1f;
index e4d261ff51124798d1472fe657104bf056073e65..60b5dc54f7b1ce9abd2c9e8cc74024dcb24eab65 100644 (file)
--- a/wdq2wav.h
+++ b/wdq2wav.h
@@ -8,7 +8,7 @@
 **
 **  Copyright (c) 2003 Kevin Rosenberg
 **
 **
 **  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
 **
 **  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
 #include <unistd.h>
 #include <getopt.h>
 
 #include <unistd.h>
 #include <getopt.h>
 
+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:
 class WindaqFile
 {
 public: