From 6130e39b18b5f53902e4eab14f6d5cdde5219563 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 1 Nov 2010 01:35:04 -0700 Subject: initial commit of public abc --- src/aig/ntl/ntlUtil.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'src/aig/ntl/ntlUtil.c') diff --git a/src/aig/ntl/ntlUtil.c b/src/aig/ntl/ntlUtil.c index 0bd86247..c3c6fd49 100644 --- a/src/aig/ntl/ntlUtil.c +++ b/src/aig/ntl/ntlUtil.c @@ -20,6 +20,9 @@ #include "ntl.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -28,6 +31,32 @@ /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// +/**Function************************************************************* + + Synopsis [Returns one if the file has a given extension.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Ntl_FileIsType( char * pFileName, char * pS1, char * pS2, char * pS3 ) +{ + int lenS, lenF = strlen(pFileName); + lenS = pS1 ? strlen(pS1) : 0; + if ( lenS && lenF > lenS && !strncmp( pFileName+lenF-lenS, pS1, lenS ) ) + return 1; + lenS = pS2 ? strlen(pS2) : 0; + if ( lenS && lenF > lenS && !strncmp( pFileName+lenF-lenS, pS2, lenS ) ) + return 1; + lenS = pS3 ? strlen(pS3) : 0; + if ( lenS && lenF > lenS && !strncmp( pFileName+lenF-lenS, pS3, lenS ) ) + return 1; + return 0; +} + /**Function************************************************************* Synopsis [Reads the maximum number of fanins.] @@ -419,7 +448,7 @@ Vec_Vec_t * Ntl_ManTransformRegClasses( Ntl_Man_t * pMan, int nSizeMax, int fVer if ( fVerbose ) { printf( "The number of selected register clases = %d.\n", Vec_PtrSize(vParts) ); - Vec_PtrForEachEntry( vParts, vPart, i ) + Vec_PtrForEachEntry( Vec_Int_t *, vParts, vPart, i ) printf( "(%d, %d) ", i, Vec_IntSize(vPart) ); printf( "\n" ); } @@ -704,3 +733,5 @@ void Ntl_ManRemoveUselessNets( Ntl_Man_t * p ) //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + -- cgit v1.2.3