1 /* FILENAME: hdr_print.c */
4 #include "dprints.h" /* for dprints */
5 #include "gribfuncs.h" /* prototypes */
9 ********************************************************************
10 * A. FUNCTION: hdr_print
11 * print specified number of bytes from the block provided.
12 * does not require Debug flag to be set;
15 * void hdr_print (title, block, bytestoprint)
17 * ARGUMENTS (I=input, O=output, I&O=input and output):
18 * (I) char *title; Title string to print
19 * (I) unsigned char *block; Block whose content to print
20 * (I) int bytestoprint; Number of bytes to print
23 ********************************************************************
26 void hdr_print (char *title
, unsigned char *block
, int bytestoprint
)
28 void hdr_print (title
, block
, bytestoprint
)
29 char *title
; unsigned char *block
; int bytestoprint
;
35 * A.1 PRINT title string
37 fprintf(stdout
,"hdr_print %d bytes of '%s'=", bytestoprint
, title
);
41 * A.2 WHILE (more bytes to print) DO
45 while (i
< bytestoprint
)
48 if (i
+7>= bytestoprint
-1)
49 fprintf(stdout
,"\n[%2d-%2d]: ",i
+1, bytestoprint
);
50 else fprintf(stdout
,"\n[%2d-%2d]: ",i
+1, i
+8);
52 fprintf(stdout
,"%03u ", block
[i
++]);
53 if (i
% 4 == 0) fprintf(stdout
, "| ");
58 * A.3 RETURN w/nothing
60 fprintf(stdout
,"Exiting hdr_print, no return code\n");