summaryrefslogtreecommitdiffstats
path: root/src/aig/ioa
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-02-11 00:22:05 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2012-02-11 00:22:05 -0800
commitc5067f7d04dc4c8ee919d9597a4a94a5c4ac3552 (patch)
tree38df5a3e37ebcfbee9bdf7db09e19c0c74df9f73 /src/aig/ioa
parent71891354b4263ceefba38bf9e882dad8117256f5 (diff)
downloadabc-c5067f7d04dc4c8ee919d9597a4a94a5c4ac3552.tar.gz
abc-c5067f7d04dc4c8ee919d9597a4a94a5c4ac3552.tar.bz2
abc-c5067f7d04dc4c8ee919d9597a4a94a5c4ac3552.zip
Graph isomorphism checking code.
Diffstat (limited to 'src/aig/ioa')
-rw-r--r--src/aig/ioa/ioa.h1
-rw-r--r--src/aig/ioa/ioaWriteAig.c27
2 files changed, 23 insertions, 5 deletions
diff --git a/src/aig/ioa/ioa.h b/src/aig/ioa/ioa.h
index b86bc13a..a427f507 100644
--- a/src/aig/ioa/ioa.h
+++ b/src/aig/ioa/ioa.h
@@ -65,6 +65,7 @@ ABC_NAMESPACE_HEADER_START
extern Aig_Man_t * Ioa_ReadAigerFromMemory( char * pContents, int nFileSize, int fCheck );
extern Aig_Man_t * Ioa_ReadAiger( char * pFileName, int fCheck );
/*=== ioaWriteAig.c =======================================================*/
+extern Vec_Str_t * Ioa_WriteAigerIntoMemoryStr( Aig_Man_t * pMan );
extern char * Ioa_WriteAigerIntoMemory( Aig_Man_t * pMan, int * pnSize );
extern void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int fCompact );
/*=== ioaUtil.c =======================================================*/
diff --git a/src/aig/ioa/ioaWriteAig.c b/src/aig/ioa/ioaWriteAig.c
index 2f682775..d19d23ff 100644
--- a/src/aig/ioa/ioaWriteAig.c
+++ b/src/aig/ioa/ioaWriteAig.c
@@ -283,9 +283,8 @@ Vec_Str_t * Ioa_WriteEncodeLiterals( Vec_Int_t * vLits )
SeeAlso []
***********************************************************************/
-char * Ioa_WriteAigerIntoMemory( Aig_Man_t * pMan, int * pnSize )
+Vec_Str_t * Ioa_WriteAigerIntoMemoryStr( Aig_Man_t * pMan )
{
- char * pBuffer;
Vec_Str_t * vBuffer;
Aig_Obj_t * pObj, * pDriver;
int nNodes, i, uLit, uLit0, uLit1;
@@ -357,10 +356,28 @@ char * Ioa_WriteAigerIntoMemory( Aig_Man_t * pMan, int * pnSize )
Ioa_WriteAigerEncodeStr( vBuffer, uLit - uLit1 );
Ioa_WriteAigerEncodeStr( vBuffer, uLit1 - uLit0 );
}
-// fprintf( pFile, "c" );
-// if ( pMan->pName )
-// fprintf( pFile, "n%s%c", pMan->pName, '\0' );
Vec_StrPrintStr( vBuffer, "c" );
+ return vBuffer;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Writes the AIG in into the memory buffer.]
+
+ Description [The resulting buffer constains the AIG in AIGER format.
+ The returned size (pnSize) gives the number of bytes in the buffer.
+ The resulting buffer should be deallocated by the user.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+char * Ioa_WriteAigerIntoMemory( Aig_Man_t * pMan, int * pnSize )
+{
+ char * pBuffer;
+ Vec_Str_t * vBuffer;
+ vBuffer = Ioa_WriteAigerIntoMemoryStr( pMan );
if ( pMan->pName )
{
Vec_StrPrintStr( vBuffer, "n" );