1 2 /** 3 * 4 * @file util.h 5 * 6 * Part of the OpenJazz project 7 * 8 * @par History: 9 * - 23rd August 2005: Created OpenJazz.h 10 * - 30th April 2010: Created util.h from parts of OpenJazz.h 11 * 12 * @par Licence: 13 * Copyright (c) 2005-2010 Alister Thomson 14 * 15 * OpenJazz is distributed under the terms of 16 * the GNU General Public License, version 2.0 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 * 22 */ 23 24 25 #ifndef _UTIL_H 26 #define _UTIL_H 27 28 29 #include "OpenJazz.h" 30 31 32 // Macros 33 34 #ifdef VERBOSE 35 #define LOG(message, detail) log(message, detail) 36 #define LOGRESULT(message, expression) log(message, expression) 37 #else 38 #define LOG(message, detail) 39 #define LOGRESULT(message, expression) expression 40 #endif 41 42 43 // Variable 44 45 /// Trigonometric function look-up table 46 EXTERN fixed sinLut[1024]; 47 48 49 // Functions 50 51 EXTERN bool fileExists (const char *fileName); 52 EXTERN unsigned short int createShort (unsigned char* data); 53 EXTERN int createInt (unsigned char* data); 54 EXTERN char* createString (const char *string); 55 EXTERN char* createString (const char *first, const char *second); 56 EXTERN char* createFileName (const char *type, int extension); 57 EXTERN char* createFileName (const char *type, const char *extension); 58 EXTERN char* createFileName (const char *type, int level, int extension); 59 EXTERN char* createEditableString (const char *string); 60 EXTERN void log (const char *message); 61 EXTERN void log (const char *message, const char *detail); 62 EXTERN void log (const char *message, int number); 63 EXTERN void logError (const char *message, const char *detail); 64 EXTERN fixed fSin (fixed angle); 65 EXTERN fixed fCos (fixed angle); 66 67 #endif 68 69