15a207
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
15a207
From: Peter Jones <pjones@redhat.com>
15a207
Date: Sun, 28 Jun 2015 13:09:58 -0400
15a207
Subject: [PATCH] Add grub_qdprintf() - grub_dprintf() without the file+line
15a207
 number.
15a207
15a207
This just makes copy+paste of our debug loading info easier.
15a207
15a207
Signed-off-by: Peter Jones <pjones@redhat.com>
15a207
---
15a207
 grub-core/kern/misc.c | 18 ++++++++++++++++++
15a207
 include/grub/misc.h   |  2 ++
15a207
 2 files changed, 20 insertions(+)
15a207
15a207
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
15a207
index 5c2d2039d0b..0e89c483d5e 100644
15a207
--- a/grub-core/kern/misc.c
15a207
+++ b/grub-core/kern/misc.c
15a207
@@ -190,6 +190,24 @@ grub_real_dprintf (const char *file, const int line, const char *condition,
15a207
     }
15a207
 }
15a207
 
15a207
+void
15a207
+grub_qdprintf (const char *condition, const char *fmt, ...)
15a207
+{
15a207
+  va_list args;
15a207
+  const char *debug = grub_env_get ("debug");
15a207
+
15a207
+  if (! debug)
15a207
+    return;
15a207
+
15a207
+  if (grub_strword (debug, "all") || grub_strword (debug, condition))
15a207
+    {
15a207
+      va_start (args, fmt);
15a207
+      grub_vprintf (fmt, args);
15a207
+      va_end (args);
15a207
+      grub_refresh ();
15a207
+    }
15a207
+}
15a207
+
15a207
 #define PREALLOC_SIZE 255
15a207
 
15a207
 int
15a207
diff --git a/include/grub/misc.h b/include/grub/misc.h
15a207
index f7473c154f0..5f1c1c1be4e 100644
15a207
--- a/include/grub/misc.h
15a207
+++ b/include/grub/misc.h
15a207
@@ -372,6 +372,8 @@ void EXPORT_FUNC(grub_real_dprintf) (const char *file,
15a207
                                      const int line,
15a207
                                      const char *condition,
15a207
                                      const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 4, 5)));
15a207
+void EXPORT_FUNC(grub_qdprintf) (const char *condition,
15a207
+				 const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 2, 3)));
15a207
 int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);
15a207
 int EXPORT_FUNC(grub_snprintf) (char *str, grub_size_t n, const char *fmt, ...)
15a207
      __attribute__ ((format (GNU_PRINTF, 3, 4)));