comparison test/automated/SDL_at.c @ 3748:9428ae743878 gsoc2009_unit_tests

Have SDL_ATprint just call SDL_ATprintVerbose.
author Edgar Simo <bobbens@gmail.com>
date Tue, 04 Aug 2009 17:53:20 +0000
parents be037e51f080
children f47658c8f87a
comparison
equal deleted inserted replaced
3747:f7a3a47e6b50 3748:9428ae743878
260 return ret; 260 return ret;
261 } 261 }
262 262
263 263
264 /** 264 /**
265 * @brief Displays a message. 265 * @brief Displays a verbose message.
266 */ 266 */
267 int SDL_ATprint( const char *msg, ... ) 267 int SDL_ATprintVerbose( int level, const char *msg, ... )
268 { 268 {
269 va_list ap; 269 va_list ap;
270 int ret; 270 int ret;
271 271
272 /* Only print if not quiet. */ 272 /* Only print if not quiet. */
273 if (at_quiet) 273 if (at_quiet || (at_verbose < level))
274 return 0; 274 return 0;
275 275
276 /* Make sure there is something to print. */ 276 /* Make sure there is something to print. */
277 if (msg == NULL) 277 if (msg == NULL)
278 return 0; 278 return 0;
284 284
285 return ret; 285 return ret;
286 } 286 }
287 287
288 288
289 /** 289
290 * @brief Displays a verbose message.
291 */
292 int SDL_ATprintVerbose( int level, const char *msg, ... )
293 {
294 va_list ap;
295 int ret;
296
297 /* Only print if not quiet. */
298 if (at_quiet || (at_verbose < level))
299 return 0;
300
301 /* Make sure there is something to print. */
302 if (msg == NULL)
303 return 0;
304 else {
305 va_start(ap, msg);
306 ret = vfprintf( stdout, msg, ap );
307 va_end(ap);
308 }
309
310 return ret;
311 }
312
313
314