This section contains a hash set implementation.
More...
|
#define | ruSetPut(rs, item) ruSetPutItem(rs, (ptr)(item)) |
| Runs ruSetPutItem with a ptr cast. More...
|
|
#define | ruSetRemove(rs, item) ruSetRemoveItem(rs, (ptr)(item)) |
| Runs ruSetRemoveItem with a ptr cast. More...
|
|
#define | ruSetHas(rs, item, code) ruSetHasItem(rs, (trans_ptr)(item), code) |
| Runs ruSetHasItem with a ptr casted item. More...
|
|
#define | ruSetFirst(rs, item) ruSetFirstSet(rs, (ptr*)(item)) |
| Runs ruSetFirstSet with a ptr cast. More...
|
|
#define | ruSetNext(rs, item) ruSetNextSet(rs, (ptr*)(item)) |
| Runs ruSetNextSet with a ptr cast. More...
|
|
|
typedef void * | ruSet |
| An opaque type representing a set object. More...
|
|
This section contains a hash set implementation.
◆ ruSetFirst
Runs ruSetFirstSet with a ptr cast.
Example:
int ret;
}
#define ruSetNext(rs, item)
Runs ruSetNextSet with a ptr cast.
Definition: map.h:375
#define ruSetFirst(rs, item)
Runs ruSetFirstSet with a ptr cast.
Definition: map.h:356
void * ptr
A generic pointer.
Definition: regify-util.h:304
#define RUE_OK
Definition: errors.h:66
- Parameters
-
rs | The set to iterate over. |
item | Where to store the current item. |
- Returns
- RUE_OK on success RUE_FILE_NOT_FOUND at the end of the set RUE_USER_ABORT when a threaded map has quit else a regify error code.
◆ ruSetHas
Runs ruSetHasItem with a ptr casted item.
- Parameters
-
rs | The set to check. |
item | The item to be searched. |
code | (Optional) Stores RUE_OK on success RUE_USER_ABORT when a threaded set has quit else a regify error code. |
- Returns
- true if item exists or false on error or if not.
◆ ruSetNext
◆ ruSetPut
Runs ruSetPutItem with a ptr cast.
- Parameters
-
rs | Set to insert key into. |
item | The item to insert. |
- Returns
- RUE_OK on success RUE_USER_ABORT when a threaded set has quit else a regify error code.
◆ ruSetRemove
Runs ruSetRemoveItem with a ptr cast.
- Parameters
-
rs | The set to remove the entry from. |
item | The item to be removed. |
- Returns
- RUE_OK on success RUE_USER_ABORT when a threaded set has quit else a regify error code.
◆ ruSet
An opaque type representing a set object.
◆ ruSetFirstSet()
RUAPI int32_t ruSetFirstSet |
( |
ruSet |
rs, |
|
|
ptr * |
item |
|
) |
| |
Initializes a set iterator and populates given parameter with the first item to serve as a for loop initializer.
- Parameters
-
rs | The set to iterate over. |
item | Where to store the current item. |
- Returns
- RUE_OK on success RUE_FILE_NOT_FOUND at the end of the set RUE_USER_ABORT when a threaded set has quit else a regify error code.
◆ ruSetFree()
Frees the given set and its members.
- Parameters
-
- Returns
- NULL
◆ ruSetHasItem()
Tests whether set contains given item.
- Parameters
-
rs | The map to check. |
item | The item to be searched. |
code | (Optional) Stores RUE_OK on success RUE_USER_ABORT when a threaded map has quit else a regify error code. |
- Returns
- true if item exists or false on error or if not.
◆ ruSetItemList()
RUAPI int32_t ruSetItemList |
( |
ruSet |
rs, |
|
|
ruList * |
items |
|
) |
| |
Return an item list of the given set.
- Parameters
-
rs | The set to get the item list from. |
items | Where to store the resulting list. |
- Returns
- RUE_OK on success, RUE_USER_ABORT when a threaded set has quit else a regify error code.
◆ ruSetNew()
Creates a new ruSet based on the given specifications.
- Parameters
-
keyType | A key specification. May be free after this call. |
- Returns
- Newly create map. Caller m ust free with ruSetFree.
◆ ruSetNextSet()
RUAPI int32_t ruSetNextSet |
( |
ruSet |
rs, |
|
|
ptr * |
item |
|
) |
| |
◆ ruSetPutItem()
RUAPI int32_t ruSetPutItem |
( |
ruSet |
rs, |
|
|
ptr |
item |
|
) |
| |
Insert an item into the set.
- Parameters
-
rs | Set to insert item into. |
item | The item to insert. |
- Returns
- RUE_OK on success, RUE_USER_ABORT when a threaded set has quit else a regify error code.
◆ ruSetRemoveAll()
RUAPI int32_t ruSetRemoveAll |
( |
ruSet |
rs | ) |
|
Removes all items from the set.
- Parameters
-
rs | The set to remove the items from. |
- Returns
- RUE_OK on success RUE_USER_ABORT when a threaded set has quit else a regify error code.
◆ ruSetRemoveItem()
RUAPI int32_t ruSetRemoveItem |
( |
ruMap |
rs, |
|
|
ptr |
item |
|
) |
| |
Removes an entry from the map.
- Parameters
-
rs | The set to remove the item from. |
item | The item to be removed. |
- Returns
- RUE_OK on success RUE_USER_ABORT when a threaded set has quit else a regify error code.
◆ ruSetSize()
RUAPI uint32_t ruSetSize |
( |
ruSet |
rs, |
|
|
int32_t * |
code |
|
) |
| |
Returns the size of the set.
- Parameters
-
rs | Set to return the size of. |
code | (Optional) Stores RUE_OK on success or regify error code. |
- Returns
- Size of the set or 0 on error.