diff --git a/dmidecode.c b/dmidecode.c index e3f6e30..8ba8d07 100644 --- a/dmidecode.c +++ b/dmidecode.c @@ -5212,8 +5212,7 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags) if (display && (!(opt.flags & FLAG_QUIET) || (opt.flags & FLAG_DUMP))) - printf("Handle 0x%04X, DMI type %d, %d bytes\n", - h.handle, h.type, h.length); + pr_handle(&h); /* Look for the next handle */ next = data + h.length; diff --git a/dmioutput.c b/dmioutput.c index e702f11..ad3b039 100644 --- a/dmioutput.c +++ b/dmioutput.c @@ -43,3 +43,9 @@ void pr_info(const char *format, ...) va_end(args); printf("\n"); } + +void pr_handle(const struct dmi_header *h) +{ + printf("Handle 0x%04X, DMI type %d, %d bytes\n", + h->handle, h->type, h->length); +} diff --git a/dmioutput.h b/dmioutput.h index 0dd8f08..6ef60f0 100644 --- a/dmioutput.h +++ b/dmioutput.h @@ -19,5 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "dmidecode.h" + void pr_comment(const char *format, ...); void pr_info(const char *format, ...); +void pr_handle(const struct dmi_header *h);