summaryrefslogtreecommitdiffstats
path: root/src/base/cba
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-08-26 14:30:42 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-08-26 14:30:42 -0700
commitcb439f2ecf000ebaab4447de120a95480b231ef5 (patch)
tree68a0b3a5df89ebaf5c22fc93cd1bcd33bfb1f785 /src/base/cba
parent41d18ca05113b33508cb67d10c2ec1fecfd4d4b2 (diff)
downloadabc-cb439f2ecf000ebaab4447de120a95480b231ef5.tar.gz
abc-cb439f2ecf000ebaab4447de120a95480b231ef5.tar.bz2
abc-cb439f2ecf000ebaab4447de120a95480b231ef5.zip
Bug fix in Vec_IntInsert() and a couple of new APIs.
Diffstat (limited to 'src/base/cba')
-rw-r--r--src/base/cba/cbaPrs.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/base/cba/cbaPrs.h b/src/base/cba/cbaPrs.h
index cd0628e6..2f5220d3 100644
--- a/src/base/cba/cbaPrs.h
+++ b/src/base/cba/cbaPrs.h
@@ -217,6 +217,24 @@ static inline void Prs_ManFinalizeNtk( Prs_Man_t * p )
p->pNtk = NULL;
}
+static inline int Prs_NtkNewStrId( Prs_Ntk_t * pNtk, const char * format, ... )
+{
+ Abc_Nam_t * p = pNtk->pStrs;
+ Vec_Str_t * vBuf = Abc_NamBuffer( p );
+ int nAdded, nSize = 1000;
+ va_list args; va_start( args, format );
+ Vec_StrGrow( vBuf, Vec_StrSize(vBuf) + nSize );
+ nAdded = vsnprintf( Vec_StrLimit(vBuf), nSize, format, args );
+ if ( nAdded > nSize )
+ {
+ Vec_StrGrow( vBuf, Vec_StrSize(vBuf) + nAdded + nSize );
+ nSize = vsnprintf( Vec_StrLimit(vBuf), nAdded, format, args );
+ assert( nSize == nAdded );
+ }
+ va_end( args );
+ return Abc_NamStrFindOrAddLim( p, Vec_StrLimit(vBuf), Vec_StrLimit(vBuf) + nAdded, NULL );
+}
+
// parsing slice/concatentation/box
static inline int Prs_NtkAddSlice( Prs_Ntk_t * p, int Name, int Range )
{