diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-05 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-05 08:01:00 -0800 |
commit | 8bd19a27bf2f50b7502d01bbbbe71714c154cd2f (patch) | |
tree | b36f9f438158f8d95e932728ab4af809a63838d1 /src/aig/ioa | |
parent | 320c429bc46728c1faddfc561c166810aa134a04 (diff) | |
download | abc-8bd19a27bf2f50b7502d01bbbbe71714c154cd2f.tar.gz abc-8bd19a27bf2f50b7502d01bbbbe71714c154cd2f.tar.bz2 abc-8bd19a27bf2f50b7502d01bbbbe71714c154cd2f.zip |
Version abc80305
Diffstat (limited to 'src/aig/ioa')
-rw-r--r-- | src/aig/ioa/ioa.h | 1 | ||||
-rw-r--r-- | src/aig/ioa/ioaUtil.c | 35 |
2 files changed, 36 insertions, 0 deletions
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 @@ -88,6 +88,41 @@ char * Ioa_FileNameGeneric( char * FileName ) /**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.] Description [The file should be closed.] |