home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Audio / AC3 / AC3Dec / debug.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-06  |  1.4 KB  |  58 lines

  1. /*
  2.  *
  3.  * debug.c
  4.  *
  5.  *    Copyright (C) Aaron Holtzman - May 1999
  6.  *
  7.  *  This file is part of ac3dec, a free Dolby AC-3 stream decoder.
  8.  *    
  9.  *  ac3dec is free software; you can redistribute it and/or modify
  10.  *  it under the terms of the GNU General Public License as published by
  11.  *  the Free Software Foundation; either version 2, or (at your option)
  12.  *  any later version.
  13.  *   
  14.  *  ac3dec is distributed in the hope that it will be useful,
  15.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  *  GNU General Public License for more details.
  18.  *   
  19.  *  You should have received a copy of the GNU General Public License
  20.  *  along with GNU Make; see the file COPYING.  If not, write to
  21.  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  22.  *
  23.  */
  24.  
  25. #include <stdlib.h>
  26. #include "debug.h"
  27.  
  28. static int debug_level = -1;
  29.  
  30. // Determine is debug output is required.
  31. // We could potentially have multiple levels of debug info
  32. int debug_is_on(void)
  33. {
  34.     char *env_var;
  35.     
  36.     if(debug_level < 0)
  37.     {
  38.       env_var = getenv("AC3_DEBUG");
  39.  
  40.         if (env_var)
  41.         {
  42.             debug_level = 1;
  43.         }
  44.         else
  45.             debug_level = 0;
  46.     }
  47.     
  48.     return debug_level;
  49. }
  50.  
  51. //If you don't have gcc, then ya don't get debug output
  52. #ifndef _DEBUG
  53. void dprintf(char fmt[],...)
  54. {
  55.     int foo = 0;
  56. }
  57. #endif
  58.