/* Reporter - Debug.c
 *
 * Version 1.00 (06-Sep-2009)
 */

/* OSLib header files.
 *
 * Requires OSLib 6.60 or later (see http://ro-oslib.sourceforge.net/).
 */

#include "oslib/report.h"

/* ANSII C header files. */

#include <stdarg.h>
#include <stdio.h>

/* Other header files. */

#include "debug.h"

/* ==================================================================================================================
 * Debug Printf
 *
 * Writes a string to Reporter, under control of the standard printf-style format string. Additional
 * parameters are supplied as required by the format.
 *
 * Parameters: format - standard printf-style format string.
 *             ...    - additional parameters as required by the format string.
 *
 * Returns:    the number of characters that were written to Reporter (or would have been, if >256).
 */

int debug_printf (char *format, ...)
{
  char    s[256];
  int     ret;
  va_list ap;

  va_start(ap, format);
  ret = vsnprintf (s, sizeof(s), format, ap);
  report_text0 (s);

  return (ret);
}
