summaryrefslogtreecommitdiffstats
path: root/src/misc/nm
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2006-06-11 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2006-06-11 08:01:00 -0700
commit3db1557f45b03875a0a0b8adddcc15c4565895d2 (patch)
tree2896d20ddcb85ae4aa7245ca28bc585f567fea54 /src/misc/nm
parent7d0921330b1f4e789901b4c2450920e7c412f95f (diff)
downloadabc-3db1557f45b03875a0a0b8adddcc15c4565895d2.tar.gz
abc-3db1557f45b03875a0a0b8adddcc15c4565895d2.tar.bz2
abc-3db1557f45b03875a0a0b8adddcc15c4565895d2.zip
Version abc60611
Diffstat (limited to 'src/misc/nm')
-rw-r--r--src/misc/nm/module.make2
-rw-r--r--src/misc/nm/nm.h2
-rw-r--r--src/misc/nm/nmApi.c47
-rw-r--r--src/misc/nm/nmInt.h1
4 files changed, 52 insertions, 0 deletions
diff --git a/src/misc/nm/module.make b/src/misc/nm/module.make
new file mode 100644
index 00000000..2a3820c7
--- /dev/null
+++ b/src/misc/nm/module.make
@@ -0,0 +1,2 @@
+SRC += src/misc/nm/nmApi.c \
+ src/misc/nm/nmTable.c
diff --git a/src/misc/nm/nm.h b/src/misc/nm/nm.h
index 5b17aaed..9c96c8ba 100644
--- a/src/misc/nm/nm.h
+++ b/src/misc/nm/nm.h
@@ -52,10 +52,12 @@ extern Nm_Man_t * Nm_ManCreate( int nSize );
extern void Nm_ManFree( Nm_Man_t * p );
extern int Nm_ManNumEntries( Nm_Man_t * p );
extern char * Nm_ManStoreIdName( Nm_Man_t * p, int ObjId, char * pName, char * pSuffix );
+extern void Nm_ManDeleteIdName( Nm_Man_t * p, int ObjId );
extern char * Nm_ManCreateUniqueName( Nm_Man_t * p, int ObjId );
extern char * Nm_ManFindNameById( Nm_Man_t * p, int ObjId );
extern int Nm_ManFindIdByName( Nm_Man_t * p, char * pName, int * pSecond );
extern void Nm_ManPrintTables( Nm_Man_t * p );
+extern Vec_Int_t * Nm_ManReturnNameIds( Nm_Man_t * p );
#ifdef __cplusplus
}
diff --git a/src/misc/nm/nmApi.c b/src/misc/nm/nmApi.c
index 72ec24e6..3a9ac074 100644
--- a/src/misc/nm/nmApi.c
+++ b/src/misc/nm/nmApi.c
@@ -135,6 +135,31 @@ char * Nm_ManStoreIdName( Nm_Man_t * p, int ObjId, char * pName, char * pSuffix
return pEntry->Name;
}
+/**Function*************************************************************
+
+ Synopsis [Creates a new entry in the name manager.]
+
+ Description [Returns 1 if the entry with the given object ID
+ already exists in the name manager.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Nm_ManDeleteIdName( Nm_Man_t * p, int ObjId )
+{
+ Nm_Entry_t * pEntry;
+ pEntry = Nm_ManTableLookupId(p, ObjId);
+ if ( pEntry == NULL )
+ {
+ printf( "Nm_ManDeleteIdName(): This entry is not in the table.\n" );
+ return;
+ }
+ // remove entry from the table
+ Nm_ManTableDelete( p, pEntry );
+}
+
/**Function*************************************************************
@@ -255,6 +280,28 @@ void Nm_ManPrintTables( Nm_Man_t * p )
printf( "\n" );
}
+/**Function*************************************************************
+
+ Synopsis [Return the IDs of objects with names.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Int_t * Nm_ManReturnNameIds( Nm_Man_t * p )
+{
+ Vec_Int_t * vNameIds;
+ int i;
+ vNameIds = Vec_IntAlloc( p->nEntries );
+ for ( i = 0; i < p->nBins; i++ )
+ if ( p->pBinsI2N[i] )
+ Vec_IntPush( vNameIds, p->pBinsI2N[i]->ObjId );
+ return vNameIds;
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
diff --git a/src/misc/nm/nmInt.h b/src/misc/nm/nmInt.h
index d0475c23..43901993 100644
--- a/src/misc/nm/nmInt.h
+++ b/src/misc/nm/nmInt.h
@@ -30,6 +30,7 @@ extern "C" {
////////////////////////////////////////////////////////////////////////
#include "extra.h"
+#include "vec.h"
#include "nm.h"
////////////////////////////////////////////////////////////////////////