Search
lxdream.org :: lxdream/src/util.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/util.c
changeset 220:f72f8a7dff88
prev187:f6ce97841afc
next422:61a0598e07ff
author nkeynes
date Tue Sep 12 08:36:09 2006 +0000 (13 years ago)
permissions -rw-r--r--
last change Add fwrite_dump32v support method to util
file annotate diff log raw
1.1 --- a/src/util.c Tue Aug 01 21:55:38 2006 +0000
1.2 +++ b/src/util.c Tue Sep 12 08:36:09 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: util.c,v 1.5 2006-08-01 21:55:38 nkeynes Exp $
1.6 + * $Id: util.c,v 1.6 2006-09-12 08:36:09 nkeynes Exp $
1.7 *
1.8 * Miscellaneous utility functions.
1.9 *
1.10 @@ -61,13 +61,17 @@
1.11 }
1.12 }
1.13
1.14 -
1.15 void fwrite_dump32( unsigned int *data, unsigned int length, FILE *f )
1.16 {
1.17 + fwrite_dump32v( data, length, 8, f );
1.18 +}
1.19 +
1.20 +void fwrite_dump32v( unsigned int *data, unsigned int length, int wordsPerLine, FILE *f )
1.21 +{
1.22 unsigned int i, j;
1.23 - for( i =0; i<length>>2; i+=8 ) {
1.24 + for( i =0; i<length>>2; i+=wordsPerLine ) {
1.25 fprintf( f, "%08X:", i);
1.26 - for( j=i; j<i+8; j++ ) {
1.27 + for( j=i; j<i+wordsPerLine; j++ ) {
1.28 if( j < length )
1.29 fprintf( f, " %08X", (unsigned int)(data[j]) );
1.30 else
.