Jason Sams | 044e2ee | 2011-08-08 16:52:30 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /** @file rs_debug.rsh |
| 18 | * \brief Utility debugging routines |
| 19 | * |
| 20 | * Routines intended to be used during application developement. These should |
| 21 | * not be used in shipping applications. All print a string and value pair to |
| 22 | * the standard log. |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | #ifndef __RS_DEBUG_RSH__ |
| 27 | #define __RS_DEBUG_RSH__ |
| 28 | |
| 29 | |
Jason Sams | 044e2ee | 2011-08-08 16:52:30 -0700 | [diff] [blame] | 30 | /** |
| 31 | * Debug function. Prints a string and value to the log. |
| 32 | */ |
| 33 | extern void __attribute__((overloadable)) |
| 34 | rsDebug(const char *, float); |
| 35 | /** |
| 36 | * Debug function. Prints a string and value to the log. |
| 37 | */ |
| 38 | extern void __attribute__((overloadable)) |
| 39 | rsDebug(const char *, float, float); |
| 40 | /** |
| 41 | * Debug function. Prints a string and value to the log. |
| 42 | */ |
| 43 | extern void __attribute__((overloadable)) |
| 44 | rsDebug(const char *, float, float, float); |
| 45 | /** |
| 46 | * Debug function. Prints a string and value to the log. |
| 47 | */ |
| 48 | extern void __attribute__((overloadable)) |
| 49 | rsDebug(const char *, float, float, float, float); |
| 50 | /** |
| 51 | * Debug function. Prints a string and value to the log. |
| 52 | */ |
| 53 | extern void __attribute__((overloadable)) |
Stephen Hines | 6537404 | 2012-05-14 18:04:10 -0700 | [diff] [blame] | 54 | rsDebug(const char *, float2); |
| 55 | /** |
| 56 | * Debug function. Prints a string and value to the log. |
| 57 | */ |
| 58 | extern void __attribute__((overloadable)) |
| 59 | rsDebug(const char *, float3); |
| 60 | /** |
| 61 | * Debug function. Prints a string and value to the log. |
| 62 | */ |
| 63 | extern void __attribute__((overloadable)) |
| 64 | rsDebug(const char *, float4); |
| 65 | /** |
| 66 | * Debug function. Prints a string and value to the log. |
| 67 | */ |
| 68 | extern void __attribute__((overloadable)) |
Jason Sams | 044e2ee | 2011-08-08 16:52:30 -0700 | [diff] [blame] | 69 | rsDebug(const char *, double); |
| 70 | /** |
| 71 | * Debug function. Prints a string and value to the log. |
| 72 | */ |
| 73 | extern void __attribute__((overloadable)) |
| 74 | rsDebug(const char *, const rs_matrix4x4 *); |
| 75 | /** |
| 76 | * Debug function. Prints a string and value to the log. |
| 77 | */ |
| 78 | extern void __attribute__((overloadable)) |
| 79 | rsDebug(const char *, const rs_matrix3x3 *); |
| 80 | /** |
| 81 | * Debug function. Prints a string and value to the log. |
| 82 | */ |
| 83 | extern void __attribute__((overloadable)) |
| 84 | rsDebug(const char *, const rs_matrix2x2 *); |
| 85 | /** |
| 86 | * Debug function. Prints a string and value to the log. |
| 87 | */ |
| 88 | extern void __attribute__((overloadable)) |
| 89 | rsDebug(const char *, int); |
| 90 | /** |
| 91 | * Debug function. Prints a string and value to the log. |
| 92 | */ |
| 93 | extern void __attribute__((overloadable)) |
| 94 | rsDebug(const char *, uint); |
| 95 | /** |
| 96 | * Debug function. Prints a string and value to the log. |
| 97 | */ |
| 98 | extern void __attribute__((overloadable)) |
| 99 | rsDebug(const char *, long); |
| 100 | /** |
| 101 | * Debug function. Prints a string and value to the log. |
| 102 | */ |
| 103 | extern void __attribute__((overloadable)) |
| 104 | rsDebug(const char *, unsigned long); |
| 105 | /** |
| 106 | * Debug function. Prints a string and value to the log. |
| 107 | */ |
| 108 | extern void __attribute__((overloadable)) |
| 109 | rsDebug(const char *, long long); |
| 110 | /** |
| 111 | * Debug function. Prints a string and value to the log. |
| 112 | */ |
| 113 | extern void __attribute__((overloadable)) |
| 114 | rsDebug(const char *, unsigned long long); |
| 115 | /** |
| 116 | * Debug function. Prints a string and value to the log. |
| 117 | */ |
| 118 | extern void __attribute__((overloadable)) |
| 119 | rsDebug(const char *, const void *); |
Rajeev Sharma | a1dd74c | 2012-07-09 03:14:47 -0700 | [diff] [blame^] | 120 | |
| 121 | #if (defined(RS_VERSION) && (RS_VERSION >= 17)) |
| 122 | /** |
| 123 | * Debug function. Prints a string and value to the log. |
| 124 | */ |
| 125 | extern void __attribute__((overloadable)) |
| 126 | rsDebug(const char *, char); |
| 127 | /** |
| 128 | * Debug function. Prints a string and value to the log. |
| 129 | */ |
| 130 | extern void __attribute__((overloadable)) |
| 131 | rsDebug(const char *, char2); |
| 132 | /** |
| 133 | * Debug function. Prints a string and value to the log. |
| 134 | */ |
| 135 | extern void __attribute__((overloadable)) |
| 136 | rsDebug(const char *, char3); |
| 137 | /** |
| 138 | * Debug function. Prints a string and value to the log. |
| 139 | */ |
| 140 | extern void __attribute__((overloadable)) |
| 141 | rsDebug(const char *, char4); |
| 142 | /** |
| 143 | * Debug function. Prints a string and value to the log. |
| 144 | */ |
| 145 | extern void __attribute__((overloadable)) |
| 146 | rsDebug(const char *, unsigned char); |
| 147 | /** |
| 148 | * Debug function. Prints a string and value to the log. |
| 149 | */ |
| 150 | extern void __attribute__((overloadable)) |
| 151 | rsDebug(const char *, uchar2); |
| 152 | /** |
| 153 | * Debug function. Prints a string and value to the log. |
| 154 | */ |
| 155 | extern void __attribute__((overloadable)) |
| 156 | rsDebug(const char *, uchar3); |
| 157 | /** |
| 158 | * Debug function. Prints a string and value to the log. |
| 159 | */ |
| 160 | extern void __attribute__((overloadable)) |
| 161 | rsDebug(const char *, uchar4); |
| 162 | /** |
| 163 | * Debug function. Prints a string and value to the log. |
| 164 | */ |
| 165 | extern void __attribute__((overloadable)) |
| 166 | rsDebug(const char *, short); |
| 167 | /** |
| 168 | * Debug function. Prints a string and value to the log. |
| 169 | */ |
| 170 | extern void __attribute__((overloadable)) |
| 171 | rsDebug(const char *, short2); |
| 172 | /** |
| 173 | * Debug function. Prints a string and value to the log. |
| 174 | */ |
| 175 | extern void __attribute__((overloadable)) |
| 176 | rsDebug(const char *, short3); |
| 177 | /** |
| 178 | * Debug function. Prints a string and value to the log. |
| 179 | */ |
| 180 | extern void __attribute__((overloadable)) |
| 181 | rsDebug(const char *, short4); |
| 182 | /** |
| 183 | * Debug function. Prints a string and value to the log. |
| 184 | */ |
| 185 | extern void __attribute__((overloadable)) |
| 186 | rsDebug(const char *, unsigned short); |
| 187 | /** |
| 188 | * Debug function. Prints a string and value to the log. |
| 189 | */ |
| 190 | extern void __attribute__((overloadable)) |
| 191 | rsDebug(const char *, ushort2); |
| 192 | /** |
| 193 | * Debug function. Prints a string and value to the log. |
| 194 | */ |
| 195 | extern void __attribute__((overloadable)) |
| 196 | rsDebug(const char *, ushort3); |
| 197 | /** |
| 198 | * Debug function. Prints a string and value to the log. |
| 199 | */ |
| 200 | extern void __attribute__((overloadable)) |
| 201 | rsDebug(const char *, ushort4); |
| 202 | /** |
| 203 | * Debug function. Prints a string and value to the log. |
| 204 | */ |
| 205 | extern void __attribute__((overloadable)) |
| 206 | rsDebug(const char *, int2); |
| 207 | /** |
| 208 | * Debug function. Prints a string and value to the log. |
| 209 | */ |
| 210 | extern void __attribute__((overloadable)) |
| 211 | rsDebug(const char *, int3); |
| 212 | /** |
| 213 | * Debug function. Prints a string and value to the log. |
| 214 | */ |
| 215 | extern void __attribute__((overloadable)) |
| 216 | rsDebug(const char *, int4); |
| 217 | /** |
| 218 | * Debug function. Prints a string and value to the log. |
| 219 | */ |
| 220 | extern void __attribute__((overloadable)) |
| 221 | rsDebug(const char *, uint2); |
| 222 | /** |
| 223 | * Debug function. Prints a string and value to the log. |
| 224 | */ |
| 225 | extern void __attribute__((overloadable)) |
| 226 | rsDebug(const char *, uint3); |
| 227 | /** |
| 228 | * Debug function. Prints a string and value to the log. |
| 229 | */ |
| 230 | extern void __attribute__((overloadable)) |
| 231 | rsDebug(const char *, uint4); |
| 232 | /** |
| 233 | * Debug function. Prints a string and value to the log. |
| 234 | */ |
| 235 | extern void __attribute__((overloadable)) |
| 236 | rsDebug(const char *, long2); |
| 237 | /** |
| 238 | * Debug function. Prints a string and value to the log. |
| 239 | */ |
| 240 | extern void __attribute__((overloadable)) |
| 241 | rsDebug(const char *, long3); |
| 242 | /** |
| 243 | * Debug function. Prints a string and value to the log. |
| 244 | */ |
| 245 | extern void __attribute__((overloadable)) |
| 246 | rsDebug(const char *, long4); |
| 247 | /** |
| 248 | * Debug function. Prints a string and value to the log. |
| 249 | */ |
| 250 | extern void __attribute__((overloadable)) |
| 251 | rsDebug(const char *, ulong2); |
| 252 | /** |
| 253 | * Debug function. Prints a string and value to the log. |
| 254 | */ |
| 255 | extern void __attribute__((overloadable)) |
| 256 | rsDebug(const char *, ulong3); |
| 257 | /** |
| 258 | * Debug function. Prints a string and value to the log. |
| 259 | */ |
| 260 | extern void __attribute__((overloadable)) |
| 261 | rsDebug(const char *, ulong4); |
| 262 | #endif // (defined(RS_VERSION) && (RS_VERSION >= 17)) |
| 263 | |
Jason Sams | 044e2ee | 2011-08-08 16:52:30 -0700 | [diff] [blame] | 264 | #define RS_DEBUG(a) rsDebug(#a, a) |
| 265 | #define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__) |
| 266 | |
Jason Sams | 044e2ee | 2011-08-08 16:52:30 -0700 | [diff] [blame] | 267 | #endif |