From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1D3Kyp-0003ed-KC for mharc-grub-devel@gnu.org; Mon, 21 Feb 2005 16:20:35 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D3Kye-0003cM-KT for grub-devel@gnu.org; Mon, 21 Feb 2005 16:20:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D3KyR-0003Vk-Is for grub-devel@gnu.org; Mon, 21 Feb 2005 16:20:13 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D3KyQ-0003Uh-QS for grub-devel@gnu.org; Mon, 21 Feb 2005 16:20:10 -0500 Received: from [217.12.11.34] (helo=smtp003.mail.ukl.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1D3KjK-0000KH-Vk for grub-devel@gnu.org; Mon, 21 Feb 2005 16:04:35 -0500 Received: from unknown (HELO ?192.168.0.2?) (subdino2004@83.194.39.152 with plain) by smtp003.mail.ukl.yahoo.com with SMTP; 21 Feb 2005 21:04:34 -0000 Message-ID: <421A4CEA.5030603@yahoo.fr> Date: Mon, 21 Feb 2005 22:04:42 +0100 From: Vincent Pelletier User-Agent: Debian Thunderbird 1.0 (X11/20050116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: The development of GRUB 2 X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [PATCH] dprintf implementation X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Feb 2005 21:20:31 -0000 -----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 * 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 ~ #include +#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-----