OSDN Git Service

[STATE] Fix FTBFS.
[csp-qt/common_source_project-fm7.git] / source / src / common.h
1 /*
2         Skelton for retropc emulator
3
4         Author : Takeda.Toshiya
5         Date   : 2006.08.18 -
6
7         [ common header ]
8 */
9
10 #ifndef _COMMON_H_
11 #define _COMMON_H_
12
13 // move shared codes to DLL???
14 //#ifdef _USE_QT
15 //      #define USE_SHARED_DLL
16 //#endif
17
18 // use zlib to decompress gzip file???
19 #ifdef _WIN32
20         #if defined(_MSC_VER) && (_MSC_VER >= 1500)
21                 #ifndef _ANY2D88
22                         #define USE_ZLIB
23                 #endif
24         #endif
25 #endif
26 #ifdef _USE_OT
27                         #define USE_ZLIB
28 #endif
29
30 // check environemnt/language
31 #ifdef _WIN32
32         #ifdef _MSC_VER
33                 // Microsoft Visual C++
34                 #if _MSC_VER == 1200
35                         // variable scope of 'for' loop for Microsoft Visual C++ 6.0
36                         #define for if(0);else for
37                 #endif
38                 #if _MSC_VER >= 1200
39                         // Microsoft Visual C++ 6.0 or later
40                         #define SUPPORT_TCHAR_TYPE
41                 #endif
42                 #if _MSC_VER >= 1400
43                         // Microsoft Visual C++ 8.0 (2005) or later
44                         #define SUPPORT_SECURE_FUNCTIONS
45                         #pragma warning( disable : 4819 )
46                         //#pragma warning( disable : 4995 )
47                         #pragma warning( disable : 4996 )
48                 #endif
49                 #if _MSC_VER >= 1800
50                         // Microsoft Visual C++ 12.0 (2013) or later
51                         #define SUPPORT_CPLUSPLUS_11
52                 #endif
53                 #define CSP_OS_WINDOWS
54         #else
55                 // Win32, but not Microsoft Visual C++
56                 #define SUPPORT_TCHAR_TYPE
57 //              #define SUPPORT_SECURE_FUNCTIONS
58         #endif
59 #endif
60 #ifdef __GNUC__
61         #if defined(Q_OS_CYGWIN) 
62                 #define CSP_OS_GCC_CYGWIN
63                 #define CSP_OS_WINDOWS
64         #elif defined(Q_OS_WIN) || defined(__WIN32) || defined(__WIN64)
65                 #define CSP_OS_GCC_WINDOWS
66                 #define CSP_OS_WINDOWS
67                 #ifdef USE_SHARED_DLL
68                         #define DLL_PREFIX   __declspec(dllexport)
69                         #define DLL_PREFIX_I __declspec(dllimport)
70                 #endif
71         #else
72                 #define CSP_OS_GCC_GENERIC
73                 #define CSP_OS_GENERIC
74                 #define DLL_PREFIX
75                 #define DLL_PREFIX_I
76         #endif
77         #if defined(__clang__)
78                 #define __CSP_COMPILER_CLANG
79         #else
80                 #define __CSP_COMPILER_GCC
81         #endif
82         #define SUPPORT_CPLUSPLUS_11
83 #else
84                 #define DLL_PREFIX
85                 #define DLL_PREFIX_I
86 #endif
87
88 #ifndef SUPPORT_CPLUSPLUS_11
89         #if defined(__cplusplus) && (__cplusplus > 199711L)
90                 #define SUPPORT_CPLUSPLUS_11
91         #endif
92 #endif
93 #ifndef SUPPORT_TCHAR_TYPE
94         // secure functions need tchar type
95         #undef SUPPORT_SECURE_FUNCTIONS
96 #endif
97 #ifndef DLL_PREFIX
98         #define DLL_PREFIX
99 #endif
100 #ifndef DLL_PREFIX_I
101         #define DLL_PREFIX_I
102 #endif
103
104 // include common header files
105 #ifdef SUPPORT_TCHAR_TYPE
106         #include <tchar.h>
107 #endif
108 #ifdef SUPPORT_CPLUSPLUS_11
109         #include <stdint.h>
110 #endif
111 #include <stdio.h>
112 #include <stdlib.h>
113 #include <string.h>
114 #ifdef _MSC_VER
115 #include <typeinfo.h>
116 #else
117 #include <typeinfo>
118 #endif
119 #include <assert.h>
120 #include <errno.h>
121
122 // include environment/language dependent header files
123 #ifdef _WIN32
124         #include <windows.h>
125         #include <windowsx.h>
126         #include <winuser.h>
127         #include <mmsystem.h>
128         #include <process.h>
129 #endif
130 #ifdef __GNUC__
131         #include <stdarg.h>
132 #endif
133 #ifdef _USE_QT
134         #ifdef _USE_QT5
135                 #include <QString>
136                 #include <QFile>
137                 #include <QtEndian>
138                 #if defined(__MINGW32__) || (__MINGW64__)
139                         #include <windows.h>
140                         #include <winbase.h>
141                 #endif
142         #else
143                 #include <QtCore/QString>
144                 #include <QtCore/QFile>
145         #endif
146         #include <sys/param.h>
147 #endif
148 #ifndef _MAX_PATH
149         #define _MAX_PATH 2048
150 #endif
151
152 // endian
153 #if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
154         #if defined(__BYTE_ORDER) && (defined(__LITTLE_ENDIAN) || defined(__BIG_ENDIAN))
155                 #if __BYTE_ORDER == __LITTLE_ENDIAN
156                         #define __LITTLE_ENDIAN__
157                 #elif __BYTE_ORDER == __BIG_ENDIAN
158                         #define __BIG_ENDIAN__
159                 #endif
160         #elif defined(SDL_BYTEORDER) && (defined(SDL_LIL_ENDIAN) || defined(SDL_BIG_ENDIAN))
161                 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
162                         #define __LITTLE_ENDIAN__
163                 #elif SDL_BYTEORDER == SDL_BIG_ENDIAN
164                         #define __BIG_ENDIAN__
165                 #endif
166         #elif defined(WORDS_LITTLEENDIAN)
167                 #define __LITTLE_ENDIAN__
168         #elif defined(WORDS_BIGENDIAN)
169                 #define __BIG_ENDIAN__
170         #endif
171 #endif
172 #if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
173         // may be Microsoft Visual C++
174         #define __LITTLE_ENDIAN__
175 #endif
176
177 // type definition
178 #ifndef SUPPORT_TCHAR_TYPE
179         #ifndef _TCHAR
180                 typedef char _TCHAR;
181         #endif
182 #endif
183
184 #ifndef SUPPORT_CPLUSPLUS_11
185         #ifndef int8_t
186                 typedef signed char int8_t;
187         #endif
188         #ifndef int16_t
189                 typedef signed short int16_t;
190         #endif
191         #ifndef int32_t
192                 typedef signed int int32_t;
193         #endif
194         #ifndef int64_t
195                 typedef signed long long int64_t;
196         #endif
197         #ifndef uint8_t
198                 typedef unsigned char uint8_t;
199         #endif
200         #ifndef uint16_t
201                 typedef unsigned short uint16_t;
202         #endif
203         #ifndef uint32_t
204                 typedef unsigned int uint32_t;
205         #endif
206         #ifndef uint64_t
207                 typedef unsigned long long uint64_t;
208         #endif
209 #endif
210
211 #ifndef _WIN32
212         #ifndef LPTSTR
213                 typedef _TCHAR* LPTSTR;
214         #endif
215         #ifndef LPCTSTR
216                 typedef const _TCHAR* LPCTSTR;
217         #endif
218         #ifndef BOOL
219                 typedef int BOOL;
220         #endif
221         #ifndef TRUE
222                 #define TRUE 1
223         #endif
224         #ifndef FALSE
225                 #define FALSE 0
226         #endif
227         #ifndef BYTE
228                 typedef uint8_t BYTE;
229         #endif
230         #ifndef WORD
231                 typedef uint16_t WORD;
232         #endif
233         #ifndef DWORD
234                 typedef uint32_t DWORD;
235         #endif
236         #ifndef QWORD
237                 typedef uint64_t QWORD;
238         #endif
239         #ifndef INT8
240                 typedef int8_t INT8;
241         #endif
242         #ifndef INT16
243                 typedef int16_t INT16;
244         #endif
245         #ifndef INT32
246                 typedef int32_t INT32;
247         #endif
248         #ifndef INT64
249                 typedef int64_t INT64;
250         #endif
251         #ifndef UINT8
252                 typedef uint8_t UINT8;
253         #endif
254         #ifndef UINT16
255                 typedef uint16_t UINT16;
256         #endif
257         #ifndef UINT32
258                 typedef uint32_t UINT32;
259         #endif
260         #ifndef UINT64
261                 typedef uint64_t UINT64;
262         #endif
263         #ifndef INT
264                 typedef int INT;
265         #endif
266         #ifndef UINT
267                 typedef unsigned int UINT;
268         #endif
269 #endif
270
271 typedef union {
272         struct {
273 #ifdef __BIG_ENDIAN__
274                 uint8_t h3, h2, h, l;
275 #else
276                 uint8_t l, h, h2, h3;
277 #endif
278         } b;
279         struct {
280 #ifdef __BIG_ENDIAN__
281                 int8_t h3, h2, h, l;
282 #else
283                 int8_t l, h, h2, h3;
284 #endif
285         } sb;
286         struct {
287 #ifdef __BIG_ENDIAN__
288                 uint16_t h, l;
289 #else
290                 uint16_t l, h;
291 #endif
292         } w;
293         struct {
294 #ifdef __BIG_ENDIAN__
295                 int16_t h, l;
296 #else
297                 int16_t l, h;
298 #endif
299         } sw;
300         uint32_t d;
301         int32_t sd;
302         inline void read_2bytes_le_from(uint8_t *t)
303         {
304                 b.l = t[0]; b.h = t[1]; b.h2 = b.h3 = 0;
305         }
306         inline void write_2bytes_le_to(uint8_t *t)
307         {
308                 t[0] = b.l; t[1] = b.h;
309         }
310         inline void read_2bytes_be_from(uint8_t *t)
311         {
312                 b.h3 = b.h2 = 0; b.h = t[0]; b.l = t[1];
313         }
314         inline void write_2bytes_be_to(uint8_t *t)
315         {
316                 t[0] = b.h; t[1] = b.l;
317         }
318         inline void read_4bytes_le_from(uint8_t *t)
319         {
320                 b.l = t[0]; b.h = t[1]; b.h2 = t[2]; b.h3 = t[3];
321         }
322         inline void write_4bytes_le_to(uint8_t *t)
323         {
324                 t[0] = b.l; t[1] = b.h; t[2] = b.h2; t[3] = b.h3;
325         }
326         inline void read_4bytes_be_from(uint8_t *t)
327         {
328                 b.h3 = t[0]; b.h2 = t[1]; b.h = t[2]; b.l = t[3];
329         }
330         inline void write_4bytes_be_to(uint8_t *t)
331         {
332                 t[0] = b.h3; t[1] = b.h2; t[2] = b.h; t[3] = b.l;
333         }
334 } pair_t;
335
336 uint32_t DLL_PREFIX EndianToLittle_DWORD(uint32_t x);
337 uint16_t DLL_PREFIX EndianToLittle_WORD(uint16_t x);
338
339 // max/min
340 #ifndef _MSC_VER
341         #undef max
342         #undef min
343         int DLL_PREFIX max(int a, int b);
344         unsigned int DLL_PREFIX max(unsigned int a, unsigned int b);
345         int DLL_PREFIX min(int a, int b);
346         unsigned int DLL_PREFIX min(unsigned int a, unsigned int b);
347 #endif
348
349 // string
350 #if defined(__GNUC__) || defined(__CYGWIN__) || defined(Q_OS_CYGWIN)
351         #define stricmp(a,b) strcasecmp(a,b)
352         #define strnicmp(a,b,n) strncasecmp(a,b,n)
353 #endif
354
355 #ifndef SUPPORT_TCHAR_TYPE
356         #ifndef _fgetts
357                 #define _fgetts fgets
358         #endif
359         #ifndef _ftprintf
360                 #define _ftprintf printf
361         #endif
362         #ifndef _tfopen
363                 #define _tfopen fopen
364         #endif
365         #ifndef _tcscmp
366                 #define _tcscmp strcmp
367         #endif
368         #ifndef _tcscpy
369                 #define _tcscpy strcpy
370         #endif
371         #ifndef _tcsicmp
372                 #define _tcsicmp stricmp
373         #endif
374         #ifndef _tcslen
375                 #define _tcslen strlen
376         #endif
377         #ifndef _tcscat
378                 #define _tcscat strcat
379         #endif
380         #ifndef _tcsncat
381                 #define _tcsncat strncat
382         #endif
383         #ifndef _tcsncpy
384                 #define _tcsncpy strncpy
385         #endif
386         #ifndef _tcsncicmp
387                 #define _tcsncicmp strnicmp
388         #endif
389         #ifndef _tcschr
390                 #define _tcschr strchr
391         #endif
392         #ifndef _tcsrchr
393                 #define _tcsrchr strrchr
394         #endif
395         #ifndef _tcsstr
396                 #define _tcsstr strstr
397         #endif
398         #ifndef _tcstok
399                 #define _tcstok strtok
400         #endif
401         #ifndef _tstoi
402                 #define _tstoi atoi
403         #endif
404         #ifndef _tcstol
405                 #define _tcstol strtol
406         #endif
407         #ifndef _tcstoul
408                 #define _tcstoul strtoul
409         #endif
410         #ifndef _stprintf
411                 #define _stprintf sprintf
412         #endif
413         #ifndef _vstprintf
414                 #define _vstprintf vsprintf
415         #endif
416         #ifndef _taccess
417                 #define _taccess access
418         #endif
419         #ifndef _tremove
420                 #define _tremove remove
421         #endif
422         #ifndef _trename
423                 #define _trename rename
424         #endif
425         #define __T(x) x
426         #define _T(x) __T(x)
427         #define _TEXT(x) __T(x)
428 #endif
429
430 #ifndef SUPPORT_SECURE_FUNCTIONS
431         #ifndef errno_t
432                 typedef int errno_t;
433         #endif
434 //      errno_t DLL_PREFIX my_tfopen_s(FILE** pFile, const _TCHAR *filename, const _TCHAR *mode);
435         errno_t DLL_PREFIX my_tcscat_s(_TCHAR *strDestination, size_t numberOfElements, const _TCHAR *strSource);
436         errno_t DLL_PREFIX my_strcpy_s(char *strDestination, size_t numberOfElements, const char *strSource);
437         errno_t DLL_PREFIX my_tcscpy_s(_TCHAR *strDestination, size_t numberOfElements, const _TCHAR *strSource);
438         errno_t DLL_PREFIX my_strncpy_s(char *strDestination, size_t numberOfElements, const char *strSource, size_t count);
439         errno_t DLL_PREFIX my_tcsncpy_s(_TCHAR *strDestination, size_t numberOfElements, const _TCHAR *strSource, size_t count);
440         char * DLL_PREFIX my_strtok_s(char *strToken, const char *strDelimit, char **context);
441         _TCHAR *DLL_PREFIX my_tcstok_s(_TCHAR *strToken, const char *strDelimit, _TCHAR **context);
442         #define my_fprintf_s fprintf
443         #define my_ftprintf_s fprintf
444         int DLL_PREFIX my_sprintf_s(char *buffer, size_t sizeOfBuffer, const char *format, ...);
445         int DLL_PREFIX my_swprintf_s(wchar_t *buffer, size_t sizeOfBuffer, const wchar_t *format, ...);
446         int DLL_PREFIX my_stprintf_s(_TCHAR *buffer, size_t sizeOfBuffer, const _TCHAR *format, ...);
447         int DLL_PREFIX my_vsprintf_s(char *buffer, size_t numberOfElements, const char *format, va_list argptr);
448         int DLL_PREFIX my_vstprintf_s(_TCHAR *buffer, size_t numberOfElements, const _TCHAR *format, va_list argptr);
449 #else
450 //      #define my_tfopen_s _tfopen_s
451         #define my_tcscat_s _tcscat_s
452         #define my_strcpy_s strcpy_s
453         #define my_tcscpy_s _tcscpy_s
454         #define my_strncpy_s strncpy_s
455         #define my_tcsncpy_s _tcsncpy_s
456         #define my_strtok_s strtok_s
457         #define my_tcstok_s _tcstok_s
458         #define my_fprintf_s fprintf_s
459         #define my_ftprintf_s _ftprintf_s
460         #define my_sprintf_s sprintf_s
461         #define my_swprintf_s swprintf_s
462         #define my_stprintf_s _stprintf_s
463         #define my_vsprintf_s vsprintf_s
464         #define my_vstprintf_s _vstprintf_s
465 #endif
466
467 // memory
468 #ifndef _MSC_VER
469         void *DLL_PREFIX my_memcpy(void *dst, void *src, size_t len);
470 #else
471         #define my_memcpy memcpy
472 #endif
473
474 // hint for SIMD
475 #if defined(__clang__)
476         #define __DECL_VECTORIZED_LOOP   _Pragma("clang loop vectorize(enable) interleave(enable)")
477 #elif defined(__GNUC__)
478         #define __DECL_VECTORIZED_LOOP  _Pragma("GCC ivdep")
479 #else
480         #define __DECL_VECTORIZED_LOOP
481 #endif
482
483 // C99 math functions
484 #ifdef _MSC_VER
485         #define my_isfinite _finite
486         #define my_log2(v) (log((double)(v)) / log(2.0))
487 #else
488         #define my_isfinite isfinite
489         #define my_log2 log2
490 #endif
491
492 // win32 api
493 #ifndef _WIN32
494         BOOL MyWritePrivateProfileString(LPCTSTR lpAppName, LPCTSTR lpKeyName, LPCTSTR lpString, LPCTSTR lpFileName);
495         DWORD MyGetPrivateProfileString(LPCTSTR lpAppName, LPCTSTR lpKeyName, LPCTSTR lpDefault, LPTSTR lpReturnedString, DWORD nSize, LPCTSTR lpFileName);
496         UINT MyGetPrivateProfileInt(LPCTSTR lpAppName, LPCTSTR lpKeyName, INT nDefault, LPCTSTR lpFileName);
497         // used only in winmain and win32 osd class
498 //      #define ZeroMemory(p,s) memset(p,0x00,s)
499 //      #define CopyMemory(t,f,s) memcpy(t,f,s)
500 #else
501         #define MyWritePrivateProfileString WritePrivateProfileString
502         #define MyGetPrivateProfileString GetPrivateProfileString
503         #define MyGetPrivateProfileInt GetPrivateProfileInt
504 #endif
505
506 // rgb color
507 #if !defined(_RGB555) && !defined(_RGB565) && !defined(_RGB888)
508         #define _RGB888
509 #endif
510
511 #if defined(_RGB555) || defined(_RGB565)
512         typedef uint16_t scrntype_t;
513         scrntype_t DLL_PREFIX RGB_COLOR(uint32_t r, uint32_t g, uint32_t b);
514         scrntype_t DLL_PREFIX RGBA_COLOR(uint32_t r, uint32_t g, uint32_t b, uint32_t a);
515         uint8_t DLL_PREFIX R_OF_COLOR(scrntype_t c);
516         uint8_t DLL_PREFIX G_OF_COLOR(scrntype_t c);
517         uint8_t DLL_PREFIX B_OF_COLOR(scrntype_t c);
518         uint8_t DLL_PREFIX A_OF_COLOR(scrntype_t c);
519 #elif defined(_RGB888)
520         typedef uint32_t scrntype_t;
521         #define RGB_COLOR(r, g, b)      (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | ((uint32_t)(b) << 0))
522         #define RGBA_COLOR(r, g, b, a)  (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | ((uint32_t)(b) << 0) | ((uint32_t)(a) << 24))
523         #define R_OF_COLOR(c)           (((c) >> 16) & 0xff)
524         #define G_OF_COLOR(c)           (((c) >>  8) & 0xff)
525         #define B_OF_COLOR(c)           (((c)      ) & 0xff)
526         #define A_OF_COLOR(c)           (((c) >> 24) & 0xff)
527 #endif
528
529 // wav file header
530 #pragma pack(1)
531 typedef struct {
532         char id[4];
533         uint32_t size;
534 } wav_chunk_t;
535 #pragma pack()
536
537 #pragma pack(1)
538 typedef struct {
539         wav_chunk_t riff_chunk;
540         char wave[4];
541         wav_chunk_t fmt_chunk;
542         uint16_t format_id;
543         uint16_t channels;
544         uint32_t sample_rate;
545         uint32_t data_speed;
546         uint16_t block_size;
547         uint16_t sample_bits;
548 } wav_header_t;
549 #pragma pack()
550
551 // file path
552 const _TCHAR *DLL_PREFIX get_application_path();
553 const _TCHAR *DLL_PREFIX create_local_path(const _TCHAR *format, ...);
554 void DLL_PREFIX create_local_path(_TCHAR *file_path, int length, const _TCHAR *format, ...);
555 const _TCHAR *DLL_PREFIX create_date_file_path(const _TCHAR *extension);
556 bool DLL_PREFIX is_absolute_path(const _TCHAR *file_path);
557 const _TCHAR *DLL_PREFIX create_absolute_path(const _TCHAR *file_name);
558 void DLL_PREFIX create_absolute_path(_TCHAR *file_path, int length, const _TCHAR *file_name);
559 void DLL_PREFIX create_date_file_path(_TCHAR *file_path, int length, const _TCHAR *extension);
560 bool DLL_PREFIX check_file_extension(const _TCHAR *file_path, const _TCHAR *ext);
561 const _TCHAR *DLL_PREFIX get_file_path_without_extensiton(const _TCHAR *file_path);
562 void DLL_PREFIX get_long_full_path_name(const _TCHAR* src, _TCHAR* dst, size_t dst_len);
563 const _TCHAR* DLL_PREFIX get_parent_dir(const _TCHAR* file);
564
565 // string
566 const _TCHAR *DLL_PREFIX create_string(const _TCHAR* format, ...);
567 const wchar_t *DLL_PREFIX char_to_wchar(const char *cs);
568 const char *DLL_PREFIX wchar_to_char(const wchar_t *ws);
569 const _TCHAR *DLL_PREFIX char_to_tchar(const char *cs);
570 const char *DLL_PREFIX tchar_to_char(const _TCHAR *ts);
571 const _TCHAR *DLL_PREFIX wchar_to_tchar(const wchar_t *ws);
572 const wchar_t *DLL_PREFIX tchar_to_wchar(const _TCHAR *ts);
573
574
575 // misc
576 int32_t DLL_PREFIX muldiv_s32(int32_t nNumber, int32_t nNumerator, int32_t nDenominator);
577 uint32_t DLL_PREFIX muldiv_u32(uint32_t nNumber, uint32_t nNumerator, uint32_t nDenominator);
578
579 uint32_t DLL_PREFIX get_crc32(uint8_t data[], int size);
580 uint32_t DLL_PREFIX calc_crc32(uint32_t seed, uint8_t data[], int size);
581 uint16_t DLL_PREFIX jis_to_sjis(uint16_t jis);
582
583 int DLL_PREFIX decibel_to_volume(int decibel);
584 int32_t DLL_PREFIX apply_volume(int32_t sample, int volume);
585
586 #define array_length(array) (sizeof(array) / sizeof(array[0]))
587
588 #define FROM_BCD(v)     (((v) & 0x0f) + (((v) >> 4) & 0x0f) * 10)
589 #define TO_BCD(v)       ((int)(((v) % 100) / 10) << 4) | ((v) % 10)
590 #define TO_BCD_LO(v)    ((v) % 10)
591 #define TO_BCD_HI(v)    (int)(((v) % 100) / 10)
592
593 // time
594 #define LEAP_YEAR(y)    (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
595
596 #define dll_cur_time_t DLL_PREFIX_I struct cur_time_s
597
598 typedef DLL_PREFIX struct cur_time_s {
599         int year, month, day, day_of_week, hour, minute, second;
600         bool initialized;
601         cur_time_s()
602         {
603                 initialized = false;
604         }
605         void increment();
606         void update_year();
607         void update_day_of_week();
608         void save_state(void *f);
609         bool load_state(void *f);
610         void save_state_helper(void *f, uint32_t *sumseed, bool *__stat);
611         bool load_state_helper(void *f, uint32_t *sumseed, bool *__stat);
612 } cur_time_t;
613
614 void DLL_PREFIX get_host_time(cur_time_t* cur_time);
615
616 // symbol
617 typedef struct symbol_s {
618         uint32_t addr;
619         _TCHAR *name;
620         struct symbol_s *next_symbol;
621 } symbol_t;
622
623 const _TCHAR* DLL_PREFIX get_symbol(symbol_t *first_symbol, uint32_t addr);
624 const _TCHAR* DLL_PREFIX get_value_or_symbol(symbol_t *first_symbol, const _TCHAR *format, uint32_t addr);
625 const _TCHAR* DLL_PREFIX get_value_and_symbol(symbol_t *first_symbol, const _TCHAR *format, uint32_t addr);
626
627 #endif