This API is useful for object value types including strings.
More...
|
#define | ruIterNext(re, type) (type) ruListNextData(&(re), NULL) |
| Returns the data payload of the next list element casted to type. More...
|
|
#define | ruListIdx(rl, index, type, code) (type)ruListIdxData(rl, index, code) |
| Returns the data payload of the element at given 0 based index casted to type. More...
|
|
|
RUAPI ptr | ruListRemove (ruList rl, ruListElmt *rle, int32_t *code) |
| Remove and return the current list element from list. More...
|
|
RUAPI ptr | ruListRemoveIdx (ruList rl, int32_t index, int32_t *code) |
| Remove and return the list element at index position from list. More...
|
|
RUAPI ptr | ruListPop (ruList rl, int32_t *code) |
| Return first element of the list. More...
|
|
RUAPI ptr | ruListTryPop (ruList rl, msec_t timeoutMs, int32_t *code) |
| Tries to return first element of the list. More...
|
|
RUAPI ptr | ruListNextData (ruListElmt *re, int32_t *code) |
| Returns the data payload of the next list element. More...
|
|
RUAPI ptr | ruListIdxData (ruList rl, int32_t index, int32_t *code) |
| Returns the data payload of the element at given 0 based index. More...
|
|
This API is useful for object value types including strings.
Example of non typed use:
printf("Recipient: %s", recip);
}
#define ruListAppend(rl, data)
Calls ruListAppendPtr but handles the void* cast.
Definition: list.h:190
void * ruIterator
Opaque pointer to list iterator object. See List Collection.
Definition: list.h:115
RUAPI ruList ruListFree(ruList rl)
Frees the given list object.
RUAPI ruList ruListNew(ruType valueType)
Creates a new list object. To be freed with ruListFree.
void * ruList
Opaque pointer to list object. See List Collection.
Definition: list.h:103
#define ruListIter(rl)
Returns the first element in the given list to iterate over.
Definition: list.h:344
#define ruIterNext(re, type)
Returns the data payload of the next list element casted to type.
Definition: list.h:399
◆ ruIterNext
Returns the data payload of the next list element casted to type.
- Parameters
-
re | Current list element to get the follower of. |
type | Data type to cast the returned data payload to. |
- Returns
- NULL if given element was the last or the data of the next element.
◆ ruListIdx
#define ruListIdx |
( |
|
rl, |
|
|
|
index, |
|
|
|
type, |
|
|
|
code |
|
) |
| (type)ruListIdxData(rl, index, code) |
Returns the data payload of the element at given 0 based index casted to type.
- Parameters
-
rl | List from which to return the element data payload. |
index | Index of the element in question. 0 is the first element. |
type | Data type to cast the returned data payload to. |
code | (Optional) Stores regify error code of this operation. RUE_OK on success RUE_USER_ABORT when a threaded list has quit else a regify error code. |
- Returns
- Data of the given element including NULL or NULL if there was an error.
◆ ruListIdxData()
RUAPI ptr ruListIdxData |
( |
ruList |
rl, |
|
|
int32_t |
index, |
|
|
int32_t * |
code |
|
) |
| |
Returns the data payload of the element at given 0 based index.
- Parameters
-
rl | List from which to return the element data payload. |
index | Index of the element in question. 0 is the first element. -1 is the last element. |
code | (Optional) Stores regify error code of this operation. RUE_OK on success RUE_USER_ABORT when a threaded list has quit else a regify error code. |
- Returns
- Data of the given element including NULL or NULL if there was an error.
◆ ruListNextData()
Returns the data payload of the next list element.
- Parameters
-
re | Address of current list element to be updated with the next one. |
code | (Optional) Stores RUE_OK on success or regify error code. |
- Returns
- NULL if error or given element was the last or the data of the next element.
◆ ruListPop()
RUAPI ptr ruListPop |
( |
ruList |
rl, |
|
|
int32_t * |
code |
|
) |
| |
Return first element of the list.
- Parameters
-
rl | List to pop object from. |
code | (Optional) Stores regify error code of this operation. RUE_OK on success RUE_FILE_NOT_FOUND on empty list RUE_USER_ABORT when a threaded list has quit else a regify error code. |
- Returns
- Object which was popped off of the list.
◆ ruListRemove()
Remove and return the current list element from list.
- Parameters
-
rl | List to remove object from. |
rle | Pointer to element to remove, will be set to the previous element to allow for deletion during iteration. |
code | (Optional) Stores regify error code of this operation. RUE_OK on success RUE_USER_ABORT when a threaded list has quit else a regify error code. |
- Returns
- Object which was removed from list.
◆ ruListRemoveIdx()
RUAPI ptr ruListRemoveIdx |
( |
ruList |
rl, |
|
|
int32_t |
index, |
|
|
int32_t * |
code |
|
) |
| |
Remove and return the list element at index position from list.
- Parameters
-
rl | List to remove object from. |
index | 0 based postion of the element to remove in the list. |
code | (Optional) Stores regify error code of this operation. RUE_OK on success RUE_USER_ABORT when a threaded list has quit else a regify error code. |
- Returns
- Object which was removed from list.
◆ ruListTryPop()
Tries to return first element of the list.
- Parameters
-
rl | List to pop object from. |
timeoutMs | The number of milliseconds to wait for an entry before returning. Setting this to 0 will return after the first check. |
code | (Optional) Stores regify error code of this operation. RUE_OK on success RUE_FILE_NOT_FOUND call timed out RUE_USER_ABORT when a threaded list has quit else a regify error code. |
- Returns
- Object which was popped off of the list.