All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dprintf implementation
@ 2005-02-21 21:04 Vincent Pelletier
  2005-02-23 23:11 ` Hollis Blanchard
  0 siblings, 1 reply; 20+ messages in thread
From: Vincent Pelletier @ 2005-02-21 21:04 UTC (permalink / raw)
  To: The development of GRUB 2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello.
I haven't worked on grub2 for 2 weeks now, sorry.
Here is the dprintf function I worked on 2 weeks ago, which I fixed this
evening.

Vincent Pelletier

2005-02-21  Vincent Pelletier  <subdino2004@yahoo.fr>

	* include/grub/misc.h (grub_dprintf): New macro.
	(grub_real_dprintf): New prototype.
	* kern/misc.c (grub_real_dprintf): New function.

Index: kern/misc.c
===================================================================
RCS file: /cvsroot/grub/grub2/kern/misc.c,v
retrieving revision 1.18
diff -u -p -r1.18 misc.c
- --- kern/misc.c	19 Feb 2005 20:56:07 -0000	1.18
+++ kern/misc.c	21 Feb 2005 20:38:38 -0000
@@ -128,6 +128,18 @@ grub_printf (const char *fmt, ...)
~   return ret;
~ }

+void
+grub_real_dprintf(const char *file, const int line, const char *title,
+                  const char *fmt, ...)
+{
+  va_list args;
+
+  grub_printf ("%s,%d (%s): ", file, line, title);
+  va_start (args, fmt);
+  grub_vprintf (fmt, args);
+  va_end (args);
+}
+
~ int
~ grub_vprintf (const char *fmt, va_list args)
~ {
Index: include/grub/misc.h
===================================================================
RCS file: /cvsroot/grub/grub2/include/grub/misc.h,v
retrieving revision 1.12
diff -u -p -r1.12 misc.h
- --- include/grub/misc.h	29 Jan 2005 22:01:53 -0000	1.12
+++ include/grub/misc.h	21 Feb 2005 20:38:38 -0000
@@ -26,6 +26,7 @@
~ #include <grub/symbol.h>
~ #include <grub/err.h>

+#define grub_dprintf(title,fmt,args...)
grub_real_dprintf(__FILE__,__LINE__,title,fmt,args);
~ /* XXX: If grub_memmove is too slow, we must implement grub_memcpy.  */
~ #define grub_memcpy(d,s,n)	grub_memmove ((d), (s), (n))

@@ -58,6 +59,10 @@ char *EXPORT_FUNC(grub_strndup) (const c
~ void *EXPORT_FUNC(grub_memset) (void *s, int c, grub_size_t n);
~ grub_size_t EXPORT_FUNC(grub_strlen) (const char *s);
~ int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__
((format (printf, 1, 2)));
+void EXPORT_FUNC(grub_real_dprintf) (const char *file,
+                                     const int line,
+                                     const char *title,
+                                     const char *fmt, ...)
__attribute__ ((format (printf, 4, 5)));
~ int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);
~ int EXPORT_FUNC(grub_sprintf) (char *str, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3)));
~ int EXPORT_FUNC(grub_vsprintf) (char *str, const char *fmt, va_list args);
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCGkzqFEQoKRQyjtURAokmAJ9Mirp8xseh2AwUJOl+tykvKm/lHgCeM07L
2pNw3UbeFYot+LOR4vDFWH4=
=+3BC
-----END PGP SIGNATURE-----





^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2005-05-09  2:08 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-21 21:04 [PATCH] dprintf implementation Vincent Pelletier
2005-02-23 23:11 ` Hollis Blanchard
2005-02-24  8:02   ` Vincent Pelletier
2005-02-24  8:49     ` Aki Tossavainen
2005-02-24 19:30     ` Yoshinori K. Okuji
2005-02-24 22:42       ` Vincent Pelletier
2005-02-25  0:18       ` Hollis Blanchard
2005-02-25  7:14         ` Aki Tossavainen
2005-02-25 11:52           ` [PATCHv2] " Vincent Pelletier
2005-02-25 16:02             ` Hollis Blanchard
2005-02-25 16:13               ` Aki Tossavainen
2005-02-25 16:41                 ` Hollis Blanchard
2005-02-25 17:12               ` Yoshinori K. Okuji
2005-02-25 18:04                 ` Vincent Pelletier
2005-02-25 18:58                   ` Yoshinori K. Okuji
2005-04-14  3:31                 ` Hollis Blanchard
2005-04-14  7:13                   ` Vincent Pelletier
2005-04-14 14:08                     ` Vincent Pelletier
2005-05-09  2:06                       ` Hollis Blanchard
2005-04-14 11:37                   ` Yoshinori K. Okuji

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.