mGNCS4Touch API Reference
v1.5.0
A set of mGNCS-compliant controls for devices with a touch screen.
include
mtouchdebug.h
1
//
3
// IMPORTANT NOTICE
4
//
5
// The following open source license statement does not apply to any
6
// entity in the Exception List published by FMSoft.
7
//
8
// For more information, please visit:
9
//
10
// https://www.fmsoft.cn/exception-list
11
//
13
/*
14
* \file mtouchdebug.h
15
* \author miniStudio team of FMSoft
16
* \date 2010/09/09
17
*
18
\verbatim
19
20
This file is part of mGNCS4Touch, one of MiniGUI components.
21
22
Copyright (C) 2008-2018 FMSoft (http://www.fmsoft.cn).
23
24
This program is free software: you can redistribute it and/or modify
25
it under the terms of the GNU General Public License as published by
26
the Free Software Foundation, either version 3 of the License, or
27
(at your option) any later version.
28
29
This program is distributed in the hope that it will be useful,
30
but WITHOUT ANY WARRANTY; without even the implied warranty of
31
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32
GNU General Public License for more details.
33
34
You should have received a copy of the GNU General Public License
35
along with this program. If not, see <http://www.gnu.org/licenses/>.
36
37
Or,
38
39
As this program is a library, any link to this program must follow
40
GNU General Public License version 3 (GPLv3). If you cannot accept
41
GPLv3, you need to be licensed from FMSoft.
42
43
If you have got a commercial license of this program, please use it
44
under the terms and conditions of the commercial license.
45
46
For more information about the commercial license, please refer to
47
<http://www.minigui.com/blog/minigui-licensing-policy/>.
48
49
\endverbatim
50
*/
51
52
#ifndef __MTOUCH_DEBUG_H__
53
#define __MTOUCH_DEBUG_H__
54
55
#ifdef __cplusplus
56
extern
"C"
{
57
#endif
58
64
#ifndef LOG_NDEBUG
65
#ifdef NDEBUG
66
#define LOG_NDEBUG 1
67
#else
68
#define LOG_NDEBUG 0
69
#endif
70
#endif
71
72
#ifndef STDIN
73
#define STDIN stdin
74
#endif
75
76
#ifndef STDOUT
77
#define STDOUT stdout
78
#endif
79
80
#ifndef STDERR
81
#define STDERR stderr
82
#endif
83
84
#ifndef PP_STR
85
#define PP_STR(str) #str
86
#endif
87
88
#ifndef LOG
89
#if LOG_NDEBUG
90
#define LOG fprintf
91
#else
92
#define LOG
93
#endif
94
#endif
95
96
// print file function and line info, macro difine
97
#ifndef LOGFFL
98
#if LOG_NDEBUG
99
#define LOGFFL(STD) LOG(STD, "%s %s() %d lines >>>> ", \
100
__FILE__, __FUNCTION__, __LINE__)
101
#else
102
#define LOGFFL(STD) ((void)0)
103
#endif
104
#endif
105
106
#ifndef LOGFFL_ENDL
107
#if LOG_NDEBUG
108
#define LOGFFL_ENDL(STD) LOG(STD, "\tFFL : %s %s() %d lines\n", \
109
__FILE__, __FUNCTION__, __LINE__)
110
#else
111
#define LOGFFL_ENDL(STD) ((void)0)
112
#endif
113
#endif
114
115
#ifndef LOGELINE
116
#if LOG_NDEBUG
117
#define LOGELINE() LOGFFL_ENDL(STDERR)
118
#else
119
#define LOGELINE()
120
#endif
121
#endif
122
123
#ifndef LOGILINE
124
#if LOG_NDEBUG
125
#define LOGILINE() LOGFFL_ENDL(STDIN)
126
#else
127
#define LOGILINE()
128
#endif
129
#endif
130
131
#ifndef LOGOLINE
132
#if LOG_NDEBUG
133
#define LOGOLINE() LOGFFL_ENDL(STDOUT)
134
#else
135
#define LOGOLINE()
136
#endif
137
#endif
138
139
// stderr print info, macro difine
140
#ifndef LOGE
141
#if LOG_NDEBUG
142
#define LOGE(...) do { LOGFFL(STDERR); LOG(STDERR, __VA_ARGS__); } while (0)
143
#else
144
#define LOGE(...) ((void)0)
145
#endif
146
#endif
147
148
// stdin print info, macro difine
149
#ifndef LOGI
150
#if LOG_NDEBUG
151
#define LOGI(...) do { LOGFFL(STDIN); LOG(STDIN, __VA_ARGS__); } while (0)
152
#else
153
#define LOGI(...) ((void)0)
154
#endif
155
#endif
156
157
// stdout print info, macro difine
158
#ifndef LOGO
159
#if LOG_NDEBUG
160
#define LOGO(...) do { LOGFFL(STDOUT); LOG(STDOUT, __VA_ARGS__); } while (0)
161
#else
162
#define LOGO(...) ((void)0)
163
#endif
164
#endif
165
166
// decimal print a variable info, macro difine
167
#ifndef LOGD
168
#if LOG_NDEBUG
169
#define LOGD(var) do { LOGFFL(STDERR); \
170
LOG(STDERR, "%s = %d\n", PP_STR(var), var); } while (0)
171
#else
172
#define LOGD(var) ((void)0)
173
#endif
174
#endif
175
176
// real print a variable info, macro difine
177
#ifndef LOGF
178
#if LOG_NDEBUG
179
#define LOGF(var) do { LOGFFL(STDERR); \
180
LOG(STDERR, "%s = %f\n", PP_STR(var), var); } while (0)
181
#else
182
#define LOGF(var) ((void)0)
183
#endif
184
#endif
185
186
// hex print a variable info, macro difine
187
#ifndef LOGH
188
#if LOG_NDEBUG
189
#define LOGH(var) do { LOGFFL(STDERR); \
190
LOG(STDERR, "%s = 0x%x\n", PP_STR(var), var); } while (0)
191
#else
192
#define LOGH(var) ((void)0)
193
#endif
194
#endif
195
196
// character print a variable info, macro difine
197
#ifndef LOGC
198
#if LOG_NDEBUG
199
#define LOGC(var) do { LOGFFL(STDERR); \
200
LOG(STDERR, "%s = %c\n", PP_STR(var), var); } while (0)
201
#else
202
#define LOGC(var) ((void)0)
203
#endif
204
#endif
205
206
// strings print a variable info, macro difine
207
#ifndef LOGS
208
#if LOG_NDEBUG
209
#define LOGS(var) do { LOGFFL(STDERR); \
210
LOG(STDERR, "%s = %s\n", PP_STR(var), var); } while (0)
211
#else
212
#define LOGS(var) ((void)0)
213
#endif
214
#endif
215
216
#ifdef __cplusplus
217
}
218
#endif
219
220
#endif //__MTOUCH_DEBUG_H__
221
Generated by
1.8.17