summaryrefslogtreecommitdiffstats
path: root/src/aig/ioa
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/ioa')
-rw-r--r--src/aig/ioa/ioa.h1
-rw-r--r--src/aig/ioa/ioaUtil.c35
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.]