|
@@ -1,10 +1,46 @@
|
1
|
1
|
#ifndef VSPRINTF_H
|
2
|
2
|
#define VSPRINTF_H
|
3
|
3
|
|
4
|
|
-/*
|
5
|
|
- * Note that we cannot use __attribute__ (( format ( printf, ... ) ))
|
6
|
|
- * to get automatic type checking on arguments, because we use
|
7
|
|
- * non-standard format characters such as "%!" and "%@".
|
|
4
|
+/** @file
|
|
5
|
+ *
|
|
6
|
+ * printf and friends.
|
|
7
|
+ *
|
|
8
|
+ * Etherboot's printf() functions understand the following format
|
|
9
|
+ * specifiers:
|
|
10
|
+ *
|
|
11
|
+ * - Hexadecimal integers
|
|
12
|
+ * - @c %[#]x - 4 bytes int (8 hex digits, lower case)
|
|
13
|
+ * - @c %[#]X - 4 bytes int (8 hex digits, upper case)
|
|
14
|
+ * - @c %[#]lx - 8 bytes long (16 hex digits, lower case)
|
|
15
|
+ * - @c %[#]lX - 8 bytes long (16 hex digits, upper case)
|
|
16
|
+ * - @c %[#]hx - 2 bytes int (4 hex digits, lower case)
|
|
17
|
+ * - @c %[#]hX - 2 bytes int (4 hex digits, upper case)
|
|
18
|
+ * - @c %[#]hhx - 1 byte int (2 hex digits, lower case)
|
|
19
|
+ * - @c %[#]hhX - 1 byte int (2 hex digits, upper case)
|
|
20
|
+ * .
|
|
21
|
+ * If the optional # prefix is specified, the output will
|
|
22
|
+ * be prefixed with 0x (or 0X).
|
|
23
|
+ *
|
|
24
|
+ * - Other integers
|
|
25
|
+ * - @c %d - decimal int
|
|
26
|
+ * .
|
|
27
|
+ * Note that any width specification (e.g. the @c 02 in @c %02x)
|
|
28
|
+ * will be accepted but ignored.
|
|
29
|
+ *
|
|
30
|
+ * - Strings and characters
|
|
31
|
+ * - @c %c - char
|
|
32
|
+ * - @c %s - string
|
|
33
|
+ * - @c %m - error message text (i.e. strerror(errno))
|
|
34
|
+ *
|
|
35
|
+ * - Etherboot-specific specifiers
|
|
36
|
+ * - @c %@ - IP address in ddd.ddd.ddd.ddd notation
|
|
37
|
+ * - @c %! - MAC address in xx:xx:xx:xx:xx:xx notation
|
|
38
|
+ *
|
|
39
|
+ *
|
|
40
|
+ * @note Unfortunately, we cannot use <tt> __attribute__ (( format (
|
|
41
|
+ * printf, ... ) )) </tt> to get automatic type checking on arguments,
|
|
42
|
+ * because we use non-standard format characters such as @c %! and
|
|
43
|
+ * @c %@.
|
8
|
44
|
*
|
9
|
45
|
*/
|
10
|
46
|
|