|
MeatAxe 2.4
|
Data Structures | |
| class | Set_t |
| A Set of Integers. More... | |
Functions | |
| int | SetIsValid (const Set_t *s) |
| Check a set. | |
| Set_t * | SetAlloc () |
| Create a new set. | |
| int | SetFree (Set_t *x) |
| Destroy a set. | |
| Set_t * | SetDup (const Set_t *s) |
| Duplicate a set. | |
| int | SetInsert (Set_t *set, long elem) |
| Insert an element into a set. | |
| int | SetPrint (char *name, const Set_t *s) |
| Write a Set to the Standar Output. | |
| int | SetContains (const Set_t *set, long elem) |
| Check if a number is in a set. | |
| Set_t* SetAlloc | ( | ) |
| int SetContains | ( | const Set_t * | set, |
| long | elem | ||
| ) |
Check if a number is in a set.
| set | Pointer to the set. |
| elem | Number to check. |
Duplicate a set.
| s | Pointer to the set. |
| int SetFree | ( | Set_t * | x | ) |
Destroy a set.
This function frees an integer set. The argument must be a Set_t structure which has previously been allocated with SetAlloc().
| x | Pointer to the set. |
| int SetInsert | ( | Set_t * | set, |
| long | elem | ||
| ) |
Insert an element into a set.
| set | Pointer to the set. |
| elem | Number to insert. |
| int SetIsValid | ( | const Set_t * | s | ) |
Check a set.
This function checks if the argument is a valid set. If the set is o.k., the function returns 1. Otherwise, an error is signaled and, if the error handler does not terminate the program, the function returns 0.
| s | Pointer to the set. |
| int SetPrint | ( | char * | name, |
| const Set_t * | s | ||
| ) |
Write a Set to the Standar Output.
This function prints a set in human-readable format on the standard output. If name is different from 0, name and a "=" is printed before the set.
| name | Name to print before the set or 0. |
| s | Pointer to the set. |