summaryrefslogtreecommitdiff
path: root/libddekit/printf.c
diff options
context:
space:
mode:
authorZheng Da <zhengda1936@gmail.com>2009-11-17 10:26:25 +0100
committerZheng Da <zhengda1936@gmail.com>2009-11-17 10:26:25 +0100
commita3eba19470c09f42272dac5ca1a34bd8a5cbe834 (patch)
tree06a10087ad78bcf7bc112de767e95d3b0a849c10 /libddekit/printf.c
parente0faf22f31c48fb27b43c1825897d26e58feafc4 (diff)
The original version of DDEKit.
Diffstat (limited to 'libddekit/printf.c')
-rw-r--r--libddekit/printf.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/libddekit/printf.c b/libddekit/printf.c
new file mode 100644
index 00000000..fb13a0b4
--- /dev/null
+++ b/libddekit/printf.c
@@ -0,0 +1,46 @@
+/*
+ * \brief Logging facility with printf()-like interface
+ * \author Thomas Friebel <yaron@yaron.de>
+ * \date 2006-03-01
+ */
+
+#include <l4/dde/ddekit/printf.h>
+
+#include <l4/log/l4log.h>
+
+/**
+ * Log constant string message w/o arguments
+ *
+ * \param msg message to be logged
+ */
+int ddekit_print(const char *msg)
+{
+ return LOG_printf("%s", msg);
+}
+
+/**
+ * Log message with print()-like arguments
+ *
+ * \param fmt format string followed by optional arguments
+ */
+int ddekit_printf(const char *fmt, ...)
+{
+ int res;
+ va_list va;
+
+ va_start(va, fmt);
+ res = ddekit_vprintf(fmt, va);
+ va_end(va);
+
+ return res;
+}
+
+/* Log message with vprintf()-like arguments
+ *
+ * \param fmt format string
+ * \param va variable argument list
+ */
+int ddekit_vprintf(const char *fmt, va_list va)
+{
+ return LOG_vprintf(fmt, va);
+}