| 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 AJ Thomson |
| 14 | * |
| 15 | * OpenJazz is distributed under the terms of |
| 16 | * the GNU General Public License, version 2.0 |
| 17 | * |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | #ifndef _UTIL_H |
| 22 | #define _UTIL_H |
| 23 | |
| 24 | #include "OpenJazz.h" |
| 25 | #include "io/file.h" |
| 26 | |
| 27 | // Variable |
| 28 | |
| 29 | /// Trigonometric function look-up table |
| 30 | EXTERN fixed sinLut[1024]; |
| 31 | |
| 32 | |
| 33 | // Functions |
| 34 | |
| 35 | bool fileExists (const char *fileName, int pathType = PATH_TYPE_ANY); |
| 36 | unsigned short int createShort (const unsigned char* data); |
| 37 | int createInt (const unsigned char* data); |
| 38 | char* createString (const char *string); |
| 39 | char* createString (const char *first, const char *second); |
| 40 | char* createFileName (const char *type, int extension); |
| 41 | char* createFileName (const char *type, const char *extension); |
| 42 | char* createFileName (const char *type, int level, int extension); |
| 43 | char* createEditableString (const char *string); |
| 44 | void lowercaseString (char *string); |
| 45 | void uppercaseString (char *string); |
| 46 | void camelcaseString (char *string); |
| 47 | fixed fSin (fixed angle); |
| 48 | fixed fCos (fixed angle); |
| 49 | unsigned char* unpackRLE (unsigned char* data, unsigned int size, unsigned int outSize); |
| 50 | void hexDump (const char * desc, const void * addr, const int len, int perLine = 16); |
| 51 | |
| 52 | #endif |