home *** CD-ROM | disk | FTP | other *** search
- #ifndef set_h
- #define set_h
-
- /*
- * Sets are things that store integers without duplicates.
- * There are
- * create, insert, lookup, and destroy operations.
- */
-
- typedef struct SETElem {
- int key; /* the key for this entry */
- } SETElem, *SETElemPtr;
-
- typedef struct SetRecord {
- SETElemPtr table;
- int maxIndex, maxCount, count;
- } SetRecord, *Set;
-
- #define NIL ((unsigned)0x80000000)
-
- Set Set_Create();
-
- Set Set_CreateSized(/* count */);
- /* int count */
-
- void Set_Insert(/* set, key */);
- /* Set set; int key; */
-
- int Set_Lookup(/* set, key */);
- /* Set set; int key; */
-
- int Set_Member(/* set, key */);
- /* Set set; int key; */
-
- void Set_Delete(/* set, key */);
- /* Set set; int key; */
-
- void Set_Destroy(/* set */);
- /* Set set; */
-
- void Set_Print(/* set */);
- /* Set set; */
-
- #define Set_For(m, key) \
- { \
- int zzIndexzz = 0; \
- while (Set_FindNext((m), &zzIndexzz, (int *)&key )) {
- #define Set_Next \
- } \
- }
-
- #define Set_Count(m) ((m)->count)
-
- #endif
-