Beispiel #1
0
int lib_rawvprintf(const char *fmt, va_list ap)
{
#if CONFIG_NFILE_DESCRIPTORS > 0

  struct lib_rawoutstream_s rawoutstream;

  /* Wrap the stdout in a stream object and let lib_vsprintf
   * do the work.
   */

  lib_rawoutstream(&rawoutstream, 1);
  return lib_vsprintf(&rawoutstream.public, fmt, ap);

#elif defined(CONFIG_ARCH_LOWPUTC)

  struct lib_outstream_s stream;

  /* Wrap the low-level output in a stream object and let lib_vsprintf
   * do the work.
   */

  lib_lowoutstream((FAR struct lib_outstream_s *)&stream);
  return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap);

#else
  return 0;
#endif
}
Beispiel #2
0
int vdprintf(int fd, FAR const char *fmt, va_list ap)
{
  struct lib_rawoutstream_s rawoutstream;

  /* Wrap the fd in a stream object and let lib_vsprintf do the work. */

   lib_rawoutstream(&rawoutstream, fd);
   return lib_vsprintf(&rawoutstream.public, fmt, ap);
}