From 8bd19a27bf2f50b7502d01bbbbe71714c154cd2f Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 5 Mar 2008 08:01:00 -0800 Subject: Version abc80305 --- src/aig/ioa/ioa.h | 1 + src/aig/ioa/ioaUtil.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) (limited to 'src/aig/ioa') diff --git a/src/aig/ioa/ioa.h b/src/aig/ioa/ioa.h index e697a729..be8594e7 100644 --- a/src/aig/ioa/ioa.h +++ b/src/aig/ioa/ioa.h @@ -66,6 +66,7 @@ extern void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fW /*=== ioaUtil.c =======================================================*/ extern int Ioa_FileSize( char * pFileName ); extern char * Ioa_FileNameGeneric( char * FileName ); +extern char * Ioa_FileNameGenericAppend( char * pBase, char * pSuffix ); extern char * Ioa_TimeStamp(); #ifdef __cplusplus diff --git a/src/aig/ioa/ioaUtil.c b/src/aig/ioa/ioaUtil.c index 79dcca1e..6063d8be 100644 --- a/src/aig/ioa/ioaUtil.c +++ b/src/aig/ioa/ioaUtil.c @@ -86,6 +86,41 @@ char * Ioa_FileNameGeneric( char * FileName ) return pRes; } +/**Function************************************************************* + + Synopsis [Returns the composite name of the file.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +char * Ioa_FileNameGenericAppend( char * pBase, char * pSuffix ) +{ + static char Buffer[1000]; + char * pDot; + if ( pBase == NULL ) + { + strcpy( Buffer, pSuffix ); + return Buffer; + } + strcpy( Buffer, pBase ); + pDot = strstr( Buffer, "." ); + if ( pDot ) + *pDot = 0; + strcat( Buffer, pSuffix ); + // find the last occurrance of slash + for ( pDot = Buffer + strlen(Buffer) - 1; pDot >= Buffer; pDot-- ) + if (!((*pDot >= '0' && *pDot <= '9') || + (*pDot >= 'a' && *pDot <= 'z') || + (*pDot >= 'A' && *pDot <= 'Z') || + *pDot == '_' || *pDot == '.') ) + break; + return pDot + 1; +} + /**Function************************************************************* Synopsis [Returns the time stamp.] -- cgit v1.2.3