You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vsprintf.h 1.5KB

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