macutils/hexbin/printhdr.c

45 lines
931 B
C
Raw Normal View History

2018-03-23 00:30:02 +00:00
#include "printhdr.h"
#include "globals.h"
#include "../util/transname.h"
2018-03-23 00:30:02 +00:00
/* print out header information in human-readable format */
2018-03-23 02:07:53 +00:00
void print_header0(int skip)
2018-03-23 00:30:02 +00:00
{
2018-03-23 02:07:53 +00:00
if (listmode) {
(void)fprintf(stderr, "name=\"%s\", ", trname);
if (skip) {
(void)fprintf(stderr, "\n");
}
2018-03-23 00:30:02 +00:00
}
}
/* print out header information in human-readable format */
2018-03-23 02:07:53 +00:00
void print_header1(int skip1, int skip2)
2018-03-23 00:30:02 +00:00
{
2018-03-23 02:07:53 +00:00
char ftype[5], fauth[5];
2018-03-23 00:30:02 +00:00
2018-03-23 02:07:53 +00:00
transname(mh.m_type, ftype, 4);
transname(mh.m_author, fauth, 4);
if (listmode) {
if (skip1) {
(void)fprintf(stderr, "\t");
}
(void)fprintf(stderr, "type=%4.4s, author=%4.4s, ", ftype, fauth);
if (skip2) {
(void)fprintf(stderr, "\n");
}
2018-03-23 00:30:02 +00:00
}
}
/* print out header information in human-readable format */
2018-03-23 02:07:53 +00:00
void print_header2(int skip)
2018-03-23 00:30:02 +00:00
{
2018-03-23 02:07:53 +00:00
if (listmode) {
if (skip) {
(void)fprintf(stderr, "\t");
}
(void)fprintf(stderr, "data=%d, rsrc=%d\n",
2018-03-23 02:07:53 +00:00
mh.m_datalen, mh.m_rsrclen);
2018-03-23 00:30:02 +00:00
}
}