Search
lxdream.org :: lxdream :: r187:f6ce97841afc
lxdream 0.9.1
released Jun 29
Download Now
changeset187:f6ce97841afc
parent186:79bfebd5e0ff
child188:91ee93613faa
authornkeynes
dateTue Aug 01 21:55:38 2006 +0000 (14 years ago)
Add fwrite_dump32 function to write out 32-bit hex words
src/util.c
1.1 --- a/src/util.c Tue Jul 11 21:51:03 2006 +0000
1.2 +++ b/src/util.c Tue Aug 01 21:55:38 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: util.c,v 1.4 2006-03-20 11:58:37 nkeynes Exp $
1.6 + * $Id: util.c,v 1.5 2006-08-01 21:55:38 nkeynes Exp $
1.7 *
1.8 * Miscellaneous utility functions.
1.9 *
1.10 @@ -60,3 +60,19 @@
1.11 fprintf( f, "\n" );
1.12 }
1.13 }
1.14 +
1.15 +
1.16 +void fwrite_dump32( unsigned int *data, unsigned int length, FILE *f )
1.17 +{
1.18 + unsigned int i, j;
1.19 + for( i =0; i<length>>2; i+=8 ) {
1.20 + fprintf( f, "%08X:", i);
1.21 + for( j=i; j<i+8; j++ ) {
1.22 + if( j < length )
1.23 + fprintf( f, " %08X", (unsigned int)(data[j]) );
1.24 + else
1.25 + fprintf( f, " " );
1.26 + }
1.27 + fprintf( f, "\n" );
1.28 + }
1.29 +}
.