SharedMeatAxe  1.0
Sets of Integers.

Detailed Description

Data Structures

class  Set_t
 A Set of Integers. More...
 

Functions

int SetIsValid (const Set_t *s)
 Check a set. More...
 
Set_tSetAlloc ()
 Create a new set. More...
 
int SetFree (Set_t *x)
 Destroy a set. More...
 
Set_tSetDup (const Set_t *s)
 Duplicate a set. More...
 
int SetInsert (Set_t *set, long elem)
 Insert an element into a set. More...
 
int SetContains (const Set_t *set, long elem)
 Check if a number is in a set. More...
 

Function Documentation

Set_t* SetAlloc ( )

Create a new set.

This function creates a new, empty set. To destroy a set, use SetFree(), not SysFree().

Returns
Pointer to the new set or 0 on error.
int SetContains ( const Set_t set,
long  elem 
)

Check if a number is in a set.

Parameters
setPointer to the set.
elemNumber to check.
Returns
1 if the set contains elem, 0 if not.
Set_t* SetDup ( const Set_t s)

Duplicate a set.

Parameters
sPointer to the set.
Returns
Pointer to a copy of the set, or 0 on error.
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().

Parameters
xPointer to the set.
Returns
0 on success, -1 on error.
int SetInsert ( Set_t set,
long  elem 
)

Insert an element into a set.

Parameters
setPointer to the set.
elemNumber to insert.
Returns
0 on success, -1 on error.
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.

Parameters
sPointer to the set.
Returns
1 if s is a valid set, 0 otherwise.

SharedMeatAxe 1.0 documentation, generated on Sat Dec 30 2017 12:13:21