From 4da784c049b79b76d8c1b82297bd27f45ead9377 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 28 Mar 2007 08:01:00 -0700 Subject: Version abc70328 --- src/misc/extra/extraUtilFile.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/misc/extra/extraUtilFile.c') diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index 6b130e7e..4c51b8b5 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -374,6 +374,34 @@ void Extra_PrintHexadecimal( FILE * pFile, unsigned Sign[], int nVars ) // fprintf( pFile, "\n" ); } +/**Function************************************************************* + + Synopsis [Prints the hex unsigned into a file.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Extra_PrintHexadecimalString( char * pString, unsigned Sign[], int nVars ) +{ + int nDigits, Digit, k; + // write the number into the file + nDigits = (1 << nVars) / 4; + for ( k = nDigits - 1; k >= 0; k-- ) + { + Digit = ((Sign[k/8] >> ((k%8) * 4)) & 15); + if ( Digit < 10 ) + *pString++ = '0' + Digit; + else + *pString++ = 'a' + Digit-10; + } +// fprintf( pFile, "\n" ); + *pString = 0; +} + /**Function************************************************************* Synopsis [Prints the hex unsigned into a file.] -- cgit v1.2.3