diff options
Diffstat (limited to 'src/aig/ioa')
-rw-r--r-- | src/aig/ioa/ioa.h | 1 | ||||
-rw-r--r-- | src/aig/ioa/ioaWriteAig.c | 27 |
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" ); |