[rtems commit] libcsupport: Add rtems_printf_plugin()

Sebastian Huber sebh at rtems.org
Mon Jun 4 15:27:26 UTC 2012


Module:    rtems
Branch:    master
Commit:    b2cb8d6fb456f3bfe39d746b79a0fbede94f5666
Changeset: http://git.rtems.org/rtems/commit/?id=b2cb8d6fb456f3bfe39d746b79a0fbede94f5666

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Jun  4 15:26:12 2012 +0200

libcsupport: Add rtems_printf_plugin()

---

 cpukit/include/rtems/bspIo.h           |    2 +
 cpukit/libcsupport/Makefile.am         |    1 +
 cpukit/libcsupport/src/printf_plugin.c |   33 ++++++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/cpukit/include/rtems/bspIo.h b/cpukit/include/rtems/bspIo.h
index 4fe7da3..d5a004a 100644
--- a/cpukit/include/rtems/bspIo.h
+++ b/cpukit/include/rtems/bspIo.h
@@ -64,6 +64,8 @@ extern void putk(const char *s);
  */
 extern int printk_plugin(void *context, const char *fmt, ...);
 
+extern int rtems_printf_plugin(void *context, const char *fmt, ...);
+
 /*
  *  Type definition for function which can be plugged in to
  *  certain reporting routines to redirect the output
diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am
index 46805e9..ae23338 100644
--- a/cpukit/libcsupport/Makefile.am
+++ b/cpukit/libcsupport/Makefile.am
@@ -120,6 +120,7 @@ BSD_LIBC_C_FILES = src/strlcpy.c src/strlcat.c src/issetugid.c
 
 libcsupport_a_SOURCES = src/gxx_wrappers.c src/getchark.c src/printk.c \
     src/printk_plugin.c src/putk.c src/vprintk.c \
+    src/printf_plugin.c \
     src/sup_fs_location.c \
     src/sup_fs_eval_path.c \
     src/sup_fs_eval_path_generic.c \
diff --git a/cpukit/libcsupport/src/printf_plugin.c b/cpukit/libcsupport/src/printf_plugin.c
new file mode 100644
index 0000000..8791327
--- /dev/null
+++ b/cpukit/libcsupport/src/printf_plugin.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/bspIo.h>
+
+#include <stdio.h>
+
+int rtems_printf_plugin(void *context, const char *format, ...)
+{
+  int rv;
+  va_list ap;
+
+  va_start(ap, format);
+  rv = vprintf(format, ap);
+  va_end(ap);
+
+  return rv;
+}




More information about the vc mailing list