annotate trunk/src/Support/Common.cc @ 278:5b8b9ea1218a

- Added a basic main function to test that all the can be fitted together - Fixed an initialisation bug in ModuleFileInput that left the buffer size at zero - Added proper description strings to the input and output modules - Fixed an out-by-a-factor-of-1000 bug in the SAI memory allocation (oops) - Added LOG_INFO_NN fucnction to log without a newline. Useful for the ASCII art module chain in aimc.cc.
author tomwalters
date Thu, 18 Feb 2010 19:35:07 +0000
parents e14c70d1b171
children 30dde71d0230
rev   line source
tomwalters@268 1 // Copyright 2006-2010, Thomas Walters, Willem van Engen
tomwalters@268 2 //
tomwalters@268 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@268 4 // http://www.acousticscale.org/AIMC
tomwalters@268 5 //
tomwalters@268 6 // This program is free software: you can redistribute it and/or modify
tomwalters@268 7 // it under the terms of the GNU General Public License as published by
tomwalters@268 8 // the Free Software Foundation, either version 3 of the License, or
tomwalters@268 9 // (at your option) any later version.
tomwalters@268 10 //
tomwalters@268 11 // This program is distributed in the hope that it will be useful,
tomwalters@268 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@268 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@268 14 // GNU General Public License for more details.
tomwalters@268 15 //
tomwalters@268 16 // You should have received a copy of the GNU General Public License
tomwalters@268 17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
tomwalters@268 18
tomwalters@268 19 #include "Support/Common.h"
tomwalters@268 20
tomwalters@268 21 namespace aimc {
tomwalters@268 22 void LOG_ERROR(const char *sFmt, ...) {
tomwalters@268 23 va_list args;
tomwalters@268 24 va_start(args, sFmt);
tomwalters@268 25 vfprintf(stderr, sFmt, args);
tomwalters@268 26 fprintf(stderr, "\n");
tomwalters@268 27 va_end(args);
tomwalters@268 28 }
tomwalters@268 29
tomwalters@268 30 void LOG_INFO(const char *sFmt, ...) {
tomwalters@268 31 va_list args;
tomwalters@268 32 va_start(args, sFmt);
tomwalters@268 33 // Just print message to console (will be lost on windows with gui)
tomwalters@268 34 vprintf(sFmt, args);
tomwalters@268 35 printf("\n");
tomwalters@268 36 va_end(args);
tomwalters@268 37 }
tomwalters@278 38
tomwalters@278 39 void LOG_INFO_NN(const char *sFmt, ...) {
tomwalters@278 40 va_list args;
tomwalters@278 41 va_start(args, sFmt);
tomwalters@278 42 // Just print message to console (will be lost on windows with gui)
tomwalters@278 43 vprintf(sFmt, args);
tomwalters@278 44 va_end(args);
tomwalters@278 45 }
tomwalters@268 46 } // namespace aimc