Re: LIbrary function for "dump"

From: William Ahern (william@wilbur.25thandClement.com)
Date: 04/18/03


From: William Ahern <william@wilbur.25thandClement.com>
Date: Fri, 18 Apr 2003 14:23:13 -0700

Norm Dresner <ndrez@att.net> wrote:
> Almost all of us at one time or another have had to write code to produce a
> classic "dump" format with, say, 16 columns of 2-digit hex numbers, one for
> each of 16 bytes, followed by a 16-character "ASCII" interpretation (where
> applicable) of each of the bytes.
>
> I'm tired of re-writing this code every time I start with a new computer and
> forget to transfer all of my old libraries and just trying to find the code
> on an old machine.

> Is there any standard "library" function to do this?

nope. but here's a little source file you can drop-in: snprintx.[ch]

        http://www.25thandclement.com/cgi-bin/cvsweb/anonnet/util/

it includes the convience macros FPRINTX, DPRINTX and PRINTX.