149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/*
249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Copyright (C) 2011 The Android Open Source Project
349c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *
449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Licensed under the Apache License, Version 2.0 (the "License");
549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * you may not use this file except in compliance with the License.
649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * You may obtain a copy of the License at
749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *
849c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *      http://www.apache.org/licenses/LICENSE-2.0
949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *
1049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Unless required by applicable law or agreed to in writing, software
1149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * distributed under the License is distributed on an "AS IS" BASIS,
1249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1349c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * See the License for the specific language governing permissions and
1449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * limitations under the License.
1549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
1649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes
1749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/** @file rs_debug.rsh
1849c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *  \brief Utility debugging routines
1949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *
2049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *  Routines intended to be used during application developement.  These should
2149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *  not be used in shipping applications.  All print a string and value pair to
2249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *  the standard log.
2349c78900da0d43140fb602431fb93212bd7f6c70Chris Banes *
246aadbd39814a5ae41e1fadfab06657cdf901e625Yigit Boyar */
2549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes
2649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes#ifndef __RS_DEBUG_RSH__
2749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes#define __RS_DEBUG_RSH__
2849c78900da0d43140fb602431fb93212bd7f6c70Chris Banes
2949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes
3049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
3149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
3249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
3349c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
3449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, float);
3549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
3649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
3749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
3849c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
3949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, float, float);
4049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
4149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
4249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
4349c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
4449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, float, float, float);
4549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
4649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
4749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
4849c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
4949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, float, float, float, float);
5049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
5149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
5249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
5349c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
5449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, float2);
5549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
5649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
5749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
5849c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
5949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, float3);
6049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
6149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
6249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
6349c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
6449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, float4);
6549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
6649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
6749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
6849c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
6949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, double);
7049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
7149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
7249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
7349c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
7449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, const rs_matrix4x4 *);
7549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
7649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
7749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
7849c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
7949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, const rs_matrix3x3 *);
8049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
8149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
8249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
8349c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
8449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, const rs_matrix2x2 *);
8549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
8649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
8749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */
8849c78900da0d43140fb602431fb93212bd7f6c70Chris Banesextern void __attribute__((overloadable))
8949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, int);
9049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
9149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Debug function.  Prints a string and value to the log.
92b3813e08451b31c599f47ebaf14c9467043cedbcYigit Boyar */
93acf94897e0924ff5fcd3c5b371ab1aa620cb1dc6Chris Banesextern void __attribute__((overloadable))
9449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, uint);
9549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes/**
966aadbd39814a5ae41e1fadfab06657cdf901e625Yigit Boyar * Debug function.  Prints a string and value to the log.
976aadbd39814a5ae41e1fadfab06657cdf901e625Yigit Boyar */
986aadbd39814a5ae41e1fadfab06657cdf901e625Yigit Boyarextern void __attribute__((overloadable))
996aadbd39814a5ae41e1fadfab06657cdf901e625Yigit Boyar    rsDebug(const char *, long);
1006aadbd39814a5ae41e1fadfab06657cdf901e625Yigit Boyar/**
1016aadbd39814a5ae41e1fadfab06657cdf901e625Yigit Boyar * Debug function.  Prints a string and value to the log.
1026aadbd39814a5ae41e1fadfab06657cdf901e625Yigit Boyar */
10346dfe0c53492ef0cb59873123ca141906fbb7dccChris Banesextern void __attribute__((overloadable))
10449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes    rsDebug(const char *, unsigned long);
105/**
106 * Debug function.  Prints a string and value to the log.
107 */
108extern void __attribute__((overloadable))
109    rsDebug(const char *, long long);
110/**
111 * Debug function.  Prints a string and value to the log.
112 */
113extern void __attribute__((overloadable))
114    rsDebug(const char *, unsigned long long);
115/**
116 * Debug function.  Prints a string and value to the log.
117 */
118extern void __attribute__((overloadable))
119    rsDebug(const char *, const void *);
120
121#if (defined(RS_VERSION) && (RS_VERSION >= 17))
122/**
123 * Debug function.  Prints a string and value to the log.
124 */
125extern void __attribute__((overloadable))
126    rsDebug(const char *, char);
127/**
128 * Debug function.  Prints a string and value to the log.
129 */
130extern void __attribute__((overloadable))
131    rsDebug(const char *, char2);
132/**
133 * Debug function.  Prints a string and value to the log.
134 */
135extern void __attribute__((overloadable))
136    rsDebug(const char *, char3);
137/**
138 * Debug function.  Prints a string and value to the log.
139 */
140extern void __attribute__((overloadable))
141    rsDebug(const char *, char4);
142/**
143 * Debug function.  Prints a string and value to the log.
144 */
145extern void __attribute__((overloadable))
146    rsDebug(const char *, unsigned char);
147/**
148 * Debug function.  Prints a string and value to the log.
149 */
150extern void __attribute__((overloadable))
151    rsDebug(const char *, uchar2);
152/**
153 * Debug function.  Prints a string and value to the log.
154 */
155extern void __attribute__((overloadable))
156    rsDebug(const char *, uchar3);
157/**
158 * Debug function.  Prints a string and value to the log.
159 */
160extern void __attribute__((overloadable))
161    rsDebug(const char *, uchar4);
162/**
163 * Debug function.  Prints a string and value to the log.
164 */
165extern void __attribute__((overloadable))
166    rsDebug(const char *, short);
167/**
168 * Debug function.  Prints a string and value to the log.
169 */
170extern void __attribute__((overloadable))
171    rsDebug(const char *, short2);
172/**
173 * Debug function.  Prints a string and value to the log.
174 */
175extern void __attribute__((overloadable))
176    rsDebug(const char *, short3);
177/**
178 * Debug function.  Prints a string and value to the log.
179 */
180extern void __attribute__((overloadable))
181    rsDebug(const char *, short4);
182/**
183 * Debug function.  Prints a string and value to the log.
184 */
185extern void __attribute__((overloadable))
186    rsDebug(const char *, unsigned short);
187/**
188 * Debug function.  Prints a string and value to the log.
189 */
190extern void __attribute__((overloadable))
191    rsDebug(const char *, ushort2);
192/**
193 * Debug function.  Prints a string and value to the log.
194 */
195extern void __attribute__((overloadable))
196    rsDebug(const char *, ushort3);
197/**
198 * Debug function.  Prints a string and value to the log.
199 */
200extern void __attribute__((overloadable))
201    rsDebug(const char *, ushort4);
202/**
203 * Debug function.  Prints a string and value to the log.
204 */
205extern void __attribute__((overloadable))
206    rsDebug(const char *, int2);
207/**
208 * Debug function.  Prints a string and value to the log.
209 */
210extern void __attribute__((overloadable))
211    rsDebug(const char *, int3);
212/**
213 * Debug function.  Prints a string and value to the log.
214 */
215extern void __attribute__((overloadable))
216    rsDebug(const char *, int4);
217/**
218 * Debug function.  Prints a string and value to the log.
219 */
220extern void __attribute__((overloadable))
221    rsDebug(const char *, uint2);
222/**
223 * Debug function.  Prints a string and value to the log.
224 */
225extern void __attribute__((overloadable))
226    rsDebug(const char *, uint3);
227/**
228 * Debug function.  Prints a string and value to the log.
229 */
230extern void __attribute__((overloadable))
231    rsDebug(const char *, uint4);
232/**
233 * Debug function.  Prints a string and value to the log.
234 */
235extern void __attribute__((overloadable))
236    rsDebug(const char *, long2);
237/**
238 * Debug function.  Prints a string and value to the log.
239 */
240extern void __attribute__((overloadable))
241    rsDebug(const char *, long3);
242/**
243 * Debug function.  Prints a string and value to the log.
244 */
245extern void __attribute__((overloadable))
246    rsDebug(const char *, long4);
247/**
248 * Debug function.  Prints a string and value to the log.
249 */
250extern void __attribute__((overloadable))
251    rsDebug(const char *, ulong2);
252/**
253 * Debug function.  Prints a string and value to the log.
254 */
255extern void __attribute__((overloadable))
256    rsDebug(const char *, ulong3);
257/**
258 * Debug function.  Prints a string and value to the log.
259 */
260extern void __attribute__((overloadable))
261    rsDebug(const char *, ulong4);
262#endif  // (defined(RS_VERSION) && (RS_VERSION >= 17))
263
264#define RS_DEBUG(a) rsDebug(#a, a)
265#define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__)
266
267#endif
268