00001 00021 #ifndef __NM_INT_H__ 00022 #define __NM_INT_H__ 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00031 00032 #include "extra.h" 00033 #include "vec.h" 00034 #include "nm.h" 00035 00039 00043 00044 typedef struct Nm_Entry_t_ Nm_Entry_t; 00045 struct Nm_Entry_t_ 00046 { 00047 unsigned Type : 4; // object type 00048 unsigned ObjId : 28; // object ID 00049 Nm_Entry_t * pNextI2N; // the next entry in the ID hash table 00050 Nm_Entry_t * pNextN2I; // the next entry in the name hash table 00051 Nm_Entry_t * pNameSake; // the next entry with the same name 00052 char Name[0]; // name of the object 00053 }; 00054 00055 struct Nm_Man_t_ 00056 { 00057 Nm_Entry_t ** pBinsI2N; // mapping IDs into names 00058 Nm_Entry_t ** pBinsN2I; // mapping names into IDs 00059 int nBins; // the number of bins in tables 00060 int nEntries; // the number of entries 00061 int nSizeFactor; // determined how much larger the table should be 00062 int nGrowthFactor; // determined how much the table grows after resizing 00063 Extra_MmFlex_t * pMem; // memory manager for entries (and names) 00064 }; 00065 00069 00073 00074 /*=== nmTable.c ==========================================================*/ 00075 extern int Nm_ManTableAdd( Nm_Man_t * p, Nm_Entry_t * pEntry ); 00076 extern int Nm_ManTableDelete( Nm_Man_t * p, int ObjId ); 00077 extern Nm_Entry_t * Nm_ManTableLookupId( Nm_Man_t * p, int ObjId ); 00078 extern Nm_Entry_t * Nm_ManTableLookupName( Nm_Man_t * p, char * pName, int Type ); 00079 extern unsigned int Cudd_PrimeNm( unsigned int p ); 00080 00081 #ifdef __cplusplus 00082 } 00083 #endif 00084 00085 #endif 00086 00090 00091