#define _COMMON_H_
// move shared codes to DLL???
-#ifdef _USE_QT
- #define USE_SHARED_DLL
-#endif
+//#ifdef _USE_QT
+// #define USE_SHARED_DLL
+//#endif
// use zlib to decompress gzip file???
#ifdef _WIN32
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
- #define USE_ZLIB
+ #ifndef _ANY2D88
+ #define USE_ZLIB
+ #endif
#endif
#endif
-
// check environemnt/language
#ifdef _WIN32
#ifdef _MSC_VER
// Microsoft Visual C++ 12.0 (2013) or later
#define SUPPORT_CPLUSPLUS_11
#endif
+ #define CSP_OS_WINDOWS
#else
// Win32, but not Microsoft Visual C++
#define SUPPORT_TCHAR_TYPE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef _MSC_VER
+#include <typeinfo.h>
+#else
+#include <typeinfo>
+#endif
#include <assert.h>
#include <errno.h>
typedef union {
struct {
#ifdef __BIG_ENDIAN__
+ uint8_t h, l;
+#else
+ uint8_t l, h;
+#endif
+ } b;
+ struct {
+#ifdef __BIG_ENDIAN__
+ int8_t h, l;
+#else
+ int8_t l, h;
+#endif
+ } sb;
+ uint16_t w;
+ int16_t sw;
+
+ inline void read_2bytes_le_from(uint8_t *t)
+ {
+ b.l = t[0]; b.h = t[1];
+ }
+ inline void write_2bytes_le_to(uint8_t *t)
+ {
+ t[0] = b.l; t[1] = b.h;
+ }
+ inline void read_2bytes_be_from(uint8_t *t)
+ {
+ b.h = t[0]; b.l = t[1];
+ }
+ inline void write_2bytes_be_to(uint8_t *t)
+ {
+ t[0] = b.h; t[1] = b.l;
+ }
+
+ inline void set_2bytes_be_from(uint16_t n)
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t h, l;
+ }b;
+ } bigv;
+ bigv.w = n;
+ b.l = bigv.b.l; b.h = bigv.b.h;
+ }
+ inline void set_2bytes_le_from(uint16_t n)
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t l, h;
+ }b;
+ } littlev;
+ littlev.w = n;
+ b.l = littlev.b.l; b.h = littlev.b.h;
+ }
+ inline uint16_t get_2bytes_be_to()
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t h, l;
+ }b;
+ } bigv;
+ bigv.b.l = b.l; bigv.b.h = b.h;
+ return bigv.w;
+ }
+ inline uint16_t get_2bytes_le_to()
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t l, h;
+ }b;
+ } littlev;
+ littlev.b.l = b.l; littlev.b.h = b.h;
+ return littlev.w;
+ }
+
+} pair16_t;
+
+typedef union {
+ struct {
+#ifdef __BIG_ENDIAN__
uint8_t h3, h2, h, l;
#else
uint8_t l, h, h2, h3;
int16_t l, h;
#endif
} sw;
+ struct {
+#ifdef __BIG_ENDIAN__
+ pair16_t h, l;
+#else
+ pair16_t l, h;
+#endif
+ } p16;
uint32_t d;
int32_t sd;
inline void read_2bytes_le_from(uint8_t *t)
{
t[0] = b.h3; t[1] = b.h2; t[2] = b.h; t[3] = b.l;
}
+
+ inline void set_2bytes_be_from(uint16_t n)
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t h, l;
+ }b;
+ } bigv;
+ bigv.w = n;
+ b.l = bigv.b.l; b.h = bigv.b.h;
+ b.h2 = 0; b.h3 = 0;
+ }
+ inline void set_2bytes_le_from(uint16_t n)
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t l, h;
+ }b;
+ } littlev;
+ littlev.w = n;
+ b.l = littlev.b.l; b.h = littlev.b.h;
+ b.h2 = 0; b.h3 = 0;
+ }
+ inline uint16_t get_2bytes_be_to()
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t h, l;
+ }b;
+ } bigv;
+ bigv.b.l = b.l; bigv.b.h = b.h;
+ return bigv.w;
+ }
+ inline uint16_t get_2bytes_le_to()
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t l, h;
+ }b;
+ } littlev;
+ littlev.b.l = b.l; littlev.b.h = b.h;
+ return littlev.w;
+ }
+
+ inline void set_4bytes_be_from(uint32_t n)
+ {
+ union {
+ uint32_t dw;
+ struct {
+ uint8_t h3, h2, h, l;
+ }b;
+ } bigv;
+ bigv.dw = n;
+ b.l = bigv.b.l; b.h = bigv.b.h; b.h2 = bigv.b.h2; b.h3 = bigv.b.h3;
+ }
+ inline void set_4bytes_le_from(uint32_t n)
+ {
+ union {
+ uint32_t dw;
+ struct {
+ uint8_t l, h, h2, h3;
+ }b;
+ } littlev;
+ littlev.dw = n;
+ b.l = littlev.b.l; b.h = littlev.b.h; b.h2 = littlev.b.h2; b.h3 = littlev.b.h3;
+ }
+ inline uint32_t get_4bytes_be_to()
+ {
+ union {
+ uint32_t dw;
+ struct {
+ uint8_t h3, h2, h, l;
+ }b;
+ } bigv;
+ bigv.b.l = b.l; bigv.b.h = b.h; bigv.b.h2 = b.h2; bigv.b.h3 = b.h3;
+ return bigv.dw;
+ }
+ inline uint32_t get_4bytes_le_to()
+ {
+ union {
+ uint32_t dw;
+ struct {
+ uint8_t l, h, h2, h3;
+ }b;
+ } littlev;
+ littlev.b.l = b.l; littlev.b.h = b.h; littlev.b.h2 = b.h2; littlev.b.h3 = b.h3;
+ return littlev.dw;
+ }
} pair_t;
+
+typedef union {
+ struct {
+#ifdef __BIG_ENDIAN__
+ uint8_t h7, h6, h5, h4, h3, h2, h, l;
+#else
+ uint8_t l, h, h2, h3, h4, h5, h6, h7;
+#endif
+ } b;
+ struct {
+#ifdef __BIG_ENDIAN__
+ int8_t h7, h6, h5, h4, h3, h2, h, l;
+#else
+ int8_t l, h, h2, h3, h4, h5, h6, h7;
+#endif
+ } sb;
+ struct {
+#ifdef __BIG_ENDIAN__
+ uint16_t h3, h2, h, l;
+#else
+ uint16_t l, h, h2, h3;
+#endif
+ } w;
+ struct {
+#ifdef __BIG_ENDIAN__
+ int16_t h3, h2, h, l;
+#else
+ int16_t l, h, h2, h3;
+#endif
+ } sw;
+ struct {
+#ifdef __BIG_ENDIAN__
+ pair16_t h3, h2, h, l;
+#else
+ pair16_t l, h, h2, h3;
+#endif
+ } p16;
+ struct {
+#ifdef __BIG_ENDIAN__
+ uint32_t h, l;
+#else
+ uint32_t l, h;
+#endif
+ } d;
+ struct {
+#ifdef __BIG_ENDIAN__
+ int32_t h, l;
+#else
+ int32_t l, h;
+#endif
+ } sd;
+ struct {
+#ifdef __BIG_ENDIAN__
+ pair_t h, l;
+#else
+ pair_t l, h;
+#endif
+ } p32;
+ uint64_t q;
+ int64_t sq;
+
+ inline void read_2bytes_le_from(uint8_t *t)
+ {
+ b.l = t[0]; b.h = t[1]; b.h2 = b.h3 = 0;
+ b.h4 = 0; b.h5 = 0; b.h6 = 0; b.h7 = 0;
+ }
+ inline void write_2bytes_le_to(uint8_t *t)
+ {
+ t[0] = b.l; t[1] = b.h;
+ }
+ inline void read_2bytes_be_from(uint8_t *t)
+ {
+ b.h3 = b.h2 = 0; b.h = t[0]; b.l = t[1];
+ b.h4 = 0; b.h5 = 0; b.h6 = 0; b.h7 = 0;
+ }
+ inline void write_2bytes_be_to(uint8_t *t)
+ {
+ t[0] = b.h; t[1] = b.l;
+ }
+ inline void read_4bytes_le_from(uint8_t *t)
+ {
+ b.l = t[0]; b.h = t[1]; b.h2 = t[2]; b.h3 = t[3];
+ b.h4 = 0; b.h5 = 0; b.h6 = 0; b.h7 = 0;
+ }
+ inline void write_4bytes_le_to(uint8_t *t)
+ {
+ t[0] = b.l; t[1] = b.h; t[2] = b.h2; t[3] = b.h3;
+ }
+ inline void read_4bytes_be_from(uint8_t *t)
+ {
+ b.h3 = t[0]; b.h2 = t[1]; b.h = t[2]; b.l = t[3];
+ b.h4 = 0; b.h5 = 0; b.h6 = 0; b.h7 = 0;
+ }
+ inline void write_4bytes_be_to(uint8_t *t)
+ {
+ t[0] = b.h3; t[1] = b.h2; t[2] = b.h; t[3] = b.l;
+ }
+
+ inline void read_8bytes_le_from(uint8_t *t)
+ {
+ b.l = t[0]; b.h = t[1]; b.h2 = t[2]; b.h3 = t[3];
+ b.h4 = t[4]; b.h5 = t[5]; b.h6 = t[6]; b.h7 = t[7];
+ }
+ inline void write_8bytes_le_to(uint8_t *t)
+ {
+ t[0] = b.l; t[1] = b.h; t[2] = b.h2; t[3] = b.h3;
+ t[4] = b.h4; t[5] = b.h5; t[6] = b.h6; t[7] = b.h7;
+ }
+ inline void read_8bytes_be_from(uint8_t *t)
+ {
+ b.h7 = t[0]; b.h6 = t[1]; b.h5 = t[2]; b.h4 = t[3];
+ b.h3 = t[4]; b.h2 = t[5]; b.h = t[6]; b.l = t[7];
+ }
+ inline void write_8bytes_be_to(uint8_t *t)
+ {
+ t[0] = b.h7; t[1] = b.h6; t[2] = b.h5; t[3] = b.h4;
+ t[4] = b.h3; t[5] = b.h2; t[6] = b.h; t[7] = b.l;
+ }
+
+ inline void set_2bytes_be_from(uint16_t n)
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t h, l;
+ }b;
+ } bigv;
+ bigv.w = n;
+ b.l = bigv.b.l; b.h = bigv.b.h;
+ b.h2 = 0; b.h3 = 0;
+ b.h4 = 0; b.h5 = 0; b.h6 = 0; b.h7 = 0;
+ }
+ inline void set_2bytes_le_from(uint16_t n)
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t l, h;
+ }b;
+ } littlev;
+ littlev.w = n;
+ b.l = littlev.b.l; b.h = littlev.b.h;
+ b.h2 = 0; b.h3 = 0;
+ b.h4 = 0; b.h5 = 0; b.h6 = 0; b.h7 = 0;
+ }
+ inline uint16_t get_2bytes_be_to()
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t h, l;
+ }b;
+ } bigv;
+ bigv.b.l = b.l; bigv.b.h = b.h;
+ return bigv.w;
+ }
+ inline uint16_t get_2bytes_le_to()
+ {
+ union {
+ uint16_t w;
+ struct {
+ uint8_t l, h;
+ }b;
+ } littlev;
+ littlev.b.l = b.l; littlev.b.h = b.h;
+ return littlev.w;
+ }
+
+ inline void set_4bytes_be_from(uint32_t n)
+ {
+ union {
+ uint32_t dw;
+ struct {
+ uint8_t h3, h2, h, l;
+ }b;
+ } bigv;
+ bigv.dw = n;
+ b.l = bigv.b.l; b.h = bigv.b.h; b.h2 = bigv.b.h2; b.h3 = bigv.b.h3;
+ b.h4 = 0; b.h5 = 0; b.h6 = 0; b.h7 = 0;
+ }
+ inline void set_4bytes_le_from(uint32_t n)
+ {
+ union {
+ uint32_t dw;
+ struct {
+ uint8_t l, h, h2, h3;
+ }b;
+ } littlev;
+ littlev.dw = n;
+ b.l = littlev.b.l; b.h = littlev.b.h; b.h2 = littlev.b.h2; b.h3 = littlev.b.h3;
+ b.h4 = 0; b.h5 = 0; b.h6 = 0; b.h7 = 0;
+ }
+ inline uint32_t get_4bytes_be_to()
+ {
+ union {
+ uint32_t dw;
+ struct {
+ uint8_t h3, h2, h, l;
+ }b;
+ } bigv;
+ bigv.b.l = b.l; bigv.b.h = b.h; bigv.b.h2 = b.h2; bigv.b.h3 = b.h3;
+ return bigv.dw;
+ }
+ inline uint32_t get_4bytes_le_to()
+ {
+ union {
+ uint32_t dw;
+ struct {
+ uint8_t l, h, h2, h3;
+ }b;
+ } littlev;
+ littlev.b.l = b.l; littlev.b.h = b.h; littlev.b.h2 = b.h2; littlev.b.h3 = b.h3;
+ return littlev.dw;
+ }
+
+ inline void set_8bytes_be_from(uint64_t n)
+ {
+ union {
+ uint64_t qw;
+ struct {
+ uint8_t h7, h6, h5, h4, h3, h2, h, l;
+ }b;
+ } bigv;
+ bigv.qw = n;
+ b.l = bigv.b.l; b.h = bigv.b.h; b.h2 = bigv.b.h2; b.h3 = bigv.b.h3;
+ b.h4 = bigv.b.h4; b.h5 = bigv.b.h5; b.h6 = bigv.b.h6; b.h7 = bigv.b.h7;
+ }
+ inline void set_8bytes_le_from(uint64_t n)
+ {
+ union {
+ uint64_t qw;
+ struct {
+ uint8_t l, h, h2, h3, h4, h5, h6, h7;
+ }b;
+ } littlev;
+ littlev.qw = n;
+ b.l = littlev.b.l; b.h = littlev.b.h; b.h2 = littlev.b.h2; b.h3 = littlev.b.h3;
+ b.h4 = littlev.b.h4; b.h5 = littlev.b.h5; b.h6 = littlev.b.h6; b.h7 = littlev.b.h7;
+ }
+ inline uint64_t get_8bytes_be_to()
+ {
+ union {
+ uint64_t qw;
+ struct {
+ uint8_t h7, h6, h5, h4, h3, h2, h, l;
+ }b;
+ } bigv;
+ bigv.b.l = b.l; bigv.b.h = b.h; bigv.b.h2 = b.h2; bigv.b.h3 = b.h3;
+ bigv.b.h4 = b.h4; bigv.b.h5 = b.h5; bigv.b.h6 = b.h6; bigv.b.h7 = b.h7;
+ return bigv.qw;
+ }
+ inline uint64_t get_8bytes_le_to()
+ {
+ union {
+ uint64_t qw;
+ struct {
+ uint8_t l, h, h2, h3, h4, h5, h6, h7;
+ }b;
+ } littlev;
+ littlev.b.l = b.l; littlev.b.h = b.h; littlev.b.h2 = b.h2; littlev.b.h3 = b.h3;
+ littlev.b.h4 = b.h4; littlev.b.h5 = b.h5; littlev.b.h6 = b.h6; littlev.b.h7 = b.h7;
+ return littlev.qw;
+ }
+
+} pair64_t;
+
uint32_t DLL_PREFIX EndianToLittle_DWORD(uint32_t x);
uint16_t DLL_PREFIX EndianToLittle_WORD(uint16_t x);
+uint32_t DLL_PREFIX EndianFromLittle_DWORD(uint32_t x);
+uint16_t DLL_PREFIX EndianFromLittle_WORD(uint16_t x);
+uint32_t DLL_PREFIX EndianToBig_DWORD(uint32_t x);
+uint16_t DLL_PREFIX EndianToBig_WORD(uint16_t x);
+uint32_t DLL_PREFIX EndianFromBig_DWORD(uint32_t x);
+uint16_t DLL_PREFIX EndianFromBig_WORD(uint16_t x);
// max/min
#ifndef _MSC_VER
#undef max
#undef min
int DLL_PREFIX max(int a, int b);
+ unsigned int DLL_PREFIX max(int a, unsigned int b);
+ unsigned int DLL_PREFIX max(unsigned int a, int b);
unsigned int DLL_PREFIX max(unsigned int a, unsigned int b);
int DLL_PREFIX min(int a, int b);
+ int DLL_PREFIX min(unsigned int a, int b);
+ int DLL_PREFIX min(int a, unsigned int b);
unsigned int DLL_PREFIX min(unsigned int a, unsigned int b);
#endif
errno_t DLL_PREFIX my_strncpy_s(char *strDestination, size_t numberOfElements, const char *strSource, size_t count);
errno_t DLL_PREFIX my_tcsncpy_s(_TCHAR *strDestination, size_t numberOfElements, const _TCHAR *strSource, size_t count);
char * DLL_PREFIX my_strtok_s(char *strToken, const char *strDelimit, char **context);
- _TCHAR * DLL_PREFIX my_tcstok_s(_TCHAR *strToken, const char *strDelimit, _TCHAR **context);
+ _TCHAR *DLL_PREFIX my_tcstok_s(_TCHAR *strToken, const char *strDelimit, _TCHAR **context);
#define my_fprintf_s fprintf
#define my_ftprintf_s fprintf
int DLL_PREFIX my_sprintf_s(char *buffer, size_t sizeOfBuffer, const char *format, ...);
#define my_vstprintf_s _vstprintf_s
#endif
+// memory
+#ifndef _MSC_VER
+ void *DLL_PREFIX my_memcpy(void *dst, void *src, size_t len);
+#else
+ #define my_memcpy memcpy
+#endif
+
+// hint for SIMD
+#if defined(__clang__)
+ #define __DECL_VECTORIZED_LOOP _Pragma("clang loop vectorize(enable) interleave(enable)")
+#elif defined(__GNUC__)
+ #define __DECL_VECTORIZED_LOOP _Pragma("GCC ivdep")
+#else
+ #define __DECL_VECTORIZED_LOOP
+#endif
+
+// C99 math functions
+#ifdef _MSC_VER
+ #define my_isfinite _finite
+ #define my_log2(v) (log((double)(v)) / log(2.0))
+#else
+ #include <cmath>
+ #define my_isfinite std::isfinite
+ #define my_log2 log2
+#endif
+
// win32 api
#ifndef _WIN32
BOOL MyWritePrivateProfileString(LPCTSTR lpAppName, LPCTSTR lpKeyName, LPCTSTR lpString, LPCTSTR lpFileName);
uint8_t DLL_PREFIX A_OF_COLOR(scrntype_t c);
#elif defined(_RGB888)
typedef uint32_t scrntype_t;
- #define RGB_COLOR(r, g, b) (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | ((uint32_t)(b) << 0))
+#if defined(__LITTLE_ENDIAN__)
+ #define RGB_COLOR(r, g, b) (((uint32_t)(b) << 16) | ((uint32_t)(g) << 8) | ((uint32_t)(r) << 0) | (0xff << 24))
+ #define RGBA_COLOR(r, g, b, a) (((uint32_t)(b) << 16) | ((uint32_t)(g) << 8) | ((uint32_t)(r) << 0) | ((uint32_t)(a) << 24))
+ #define R_OF_COLOR(c) (((c) ) & 0xff)
+ #define G_OF_COLOR(c) (((c) >> 8) & 0xff)
+ #define B_OF_COLOR(c) (((c) >> 16) & 0xff)
+ #define A_OF_COLOR(c) (((c) >> 24) & 0xff)
+#else
+ #define RGB_COLOR(r, g, b) (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | ((uint32_t)(b) << 0) | (0xff << 24))
#define RGBA_COLOR(r, g, b, a) (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | ((uint32_t)(b) << 0) | ((uint32_t)(a) << 24))
#define R_OF_COLOR(c) (((c) >> 16) & 0xff)
#define G_OF_COLOR(c) (((c) >> 8) & 0xff)
#define B_OF_COLOR(c) (((c) ) & 0xff)
#define A_OF_COLOR(c) (((c) >> 24) & 0xff)
#endif
+#endif
+
+inline uint64_t ExchangeEndianU64(uint64_t __in)
+{
+ pair64_t __i, __o;
+ __i.q = __in;
+ __o.b.h7 = __i.b.l;
+ __o.b.h6 = __i.b.h;
+ __o.b.h5 = __i.b.h2;
+ __o.b.h4 = __i.b.h3;
+ __o.b.h3 = __i.b.h4;
+ __o.b.h2 = __i.b.h5;
+ __o.b.h = __i.b.h6;
+ __o.b.l = __i.b.h7;
+ return __o.q;
+}
+
+inline int64_t ExchangeEndianS64(uint64_t __in)
+{
+ pair64_t __i, __o;
+ __i.q = __in;
+ __o.b.h7 = __i.b.l;
+ __o.b.h6 = __i.b.h;
+ __o.b.h5 = __i.b.h2;
+ __o.b.h4 = __i.b.h3;
+ __o.b.h3 = __i.b.h4;
+ __o.b.h2 = __i.b.h5;
+ __o.b.h = __i.b.h6;
+ __o.b.l = __i.b.h7;
+ return __o.sq;
+}
+inline uint32_t ExchangeEndianU32(uint32_t __in)
+{
+ pair_t __i, __o;
+ __i.d = __in;
+ __o.b.h3 = __i.b.l;
+ __o.b.h2 = __i.b.h;
+ __o.b.h = __i.b.h2;
+ __o.b.l = __i.b.h3;
+ return __o.d;
+}
+
+inline int32_t ExchangeEndianS32(uint32_t __in)
+{
+ pair_t __i, __o;
+ __i.d = __in;
+ __o.b.h3 = __i.b.l;
+ __o.b.h2 = __i.b.h;
+ __o.b.h = __i.b.h2;
+ __o.b.l = __i.b.h3;
+ return __o.sd;
+}
+
+inline uint16_t ExchangeEndianU16(uint16_t __in)
+{
+ pair16_t __i, __o;
+ __i.w = __in;
+ __o.b.h = __i.b.l;
+ __o.b.l = __i.b.h;
+ return __o.w;
+}
+
+inline int16_t ExchangeEndianS16(uint16_t __in)
+{
+ pair16_t __i, __o;
+ __i.w = __in;
+ __o.b.h = __i.b.l;
+ __o.b.l = __i.b.h;
+ return __o.sw;
+}
// wav file header
#pragma pack(1)
} wav_header_t;
#pragma pack()
+// See http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html.
+#pragma pack(1)
+typedef struct {
+ wav_chunk_t riff_chunk;
+ char wave[4];
+ wav_chunk_t fmt_chunk;
+ uint16_t format_id;
+ uint16_t channels;
+ uint32_t sample_rate;
+ uint32_t data_speed;
+ uint16_t block_size;
+ uint16_t sample_bits;
+ uint16_t cbsize; // Extension size.Normaly set to 0.
+ wav_chunk_t fact_chunk; // "fact", 4.
+} wav_header_float_t;
+#pragma pack()
+
+// Use this before writing wav_data.
+bool DLL_PREFIX write_dummy_wav_header(void *__fio);
+// Use this after writng wav_data.
+bool DLL_PREFIX set_wav_header(wav_header_t *header, wav_chunk_t *first_chunk, uint16_t channels, uint32_t rate,
+ uint16_t bits, size_t file_length);
+bool DLL_PREFIX load_wav_to_stereo(void *__fio, int16_t **left_buf, int16_t **right_buf, uint32_t *rate, int *got_samples);
+bool DLL_PREFIX load_wav_to_monoral(void *__fio, int16_t **buffer, uint32_t *rate, int *got_samples);
+
// file path
const _TCHAR *DLL_PREFIX get_application_path();
+const _TCHAR *DLL_PREFIX get_initial_current_path();
const _TCHAR *DLL_PREFIX create_local_path(const _TCHAR *format, ...);
void DLL_PREFIX create_local_path(_TCHAR *file_path, int length, const _TCHAR *format, ...);
const _TCHAR *DLL_PREFIX create_date_file_path(const _TCHAR *extension);
+bool DLL_PREFIX is_absolute_path(const _TCHAR *file_path);
void DLL_PREFIX create_date_file_path(_TCHAR *file_path, int length, const _TCHAR *extension);
bool DLL_PREFIX check_file_extension(const _TCHAR *file_path, const _TCHAR *ext);
const _TCHAR *DLL_PREFIX get_file_path_without_extensiton(const _TCHAR *file_path);
const _TCHAR *DLL_PREFIX wchar_to_tchar(const wchar_t *ws);
const wchar_t *DLL_PREFIX tchar_to_wchar(const _TCHAR *ts);
+
// misc
+void DLL_PREFIX common_initialize();
+
int32_t DLL_PREFIX muldiv_s32(int32_t nNumber, int32_t nNumerator, int32_t nDenominator);
uint32_t DLL_PREFIX muldiv_u32(uint32_t nNumber, uint32_t nNumerator, uint32_t nDenominator);
uint32_t DLL_PREFIX get_crc32(uint8_t data[], int size);
+uint32_t DLL_PREFIX calc_crc32(uint32_t seed, uint8_t data[], int size);
uint16_t DLL_PREFIX jis_to_sjis(uint16_t jis);
int DLL_PREFIX decibel_to_volume(int decibel);
void update_day_of_week();
void save_state(void *f);
bool load_state(void *f);
+ void save_state_helper(void *f, uint32_t *sumseed, bool *__stat);
+ bool load_state_helper(void *f, uint32_t *sumseed, bool *__stat);
} cur_time_t;
void DLL_PREFIX get_host_time(cur_time_t* cur_time);
+const _TCHAR DLL_PREFIX *get_lib_common_version();
// symbol
typedef struct symbol_s {