This API is useful for scalar types such as int, long or bool.
More...
|
#define | ruListRemoveTo(rl, rle, dest) ruListRemoveDataTo(rl, &(rle), (ptr*)&(dest)) |
| Remove and return the current list element from list. More...
|
|
#define | ruListRemoveIdxTo(rl, index, dest) ruListRemoveIdxDataTo(rl, index, (ptr*)&(dest)) |
| Remove and return the list element at index position from list. More...
|
|
#define | ruListPopTo(rl, dest) ruListPopDataTo(rl, (ptr*)&(dest)) |
| Return first element of the list. More...
|
|
#define | ruListTryPopTo(rl, timeoutMs, dest) ruListTryPopDataTo(rl, timeoutMs, (ptr*)&(dest)) |
| Tries to return first element of the list. More...
|
|
#define | ruIterTo(re, dest) ruListNextDataTo(&(re), (ptr*)&(dest)) |
| Returns the next element data in the given list to iterate over. More...
|
|
#define | ruListIdxTo(rl, index, dest) ruListIdxDataTo(rl, index, (ptr*)&(dest)) |
| Returns the data payload of the element at given 0 based index casted to type. More...
|
|
|
RUAPI int32_t | ruListRemoveDataTo (ruList rl, ruListElmt *rle, ptr *dest) |
| Remove and return the current list element from list. More...
|
|
RUAPI int32_t | ruListRemoveIdxDataTo (ruList rl, int32_t index, ptr *dest) |
| Remove and return the list element at index position from list. More...
|
|
RUAPI int32_t | ruListPopDataTo (ruList rl, ptr *dest) |
| Return first element of the list. More...
|
|
RUAPI int32_t | ruListTryPopDataTo (ruList rl, msec_t timeoutMs, ptr *dest) |
| Tries to return first element of the list. More...
|
|
RUAPI int32_t | ruListNextDataTo (ruListElmt *re, ptr *dest) |
| Returns the data payload of the next list element. More...
|
|
RUAPI int32_t | ruListIdxDataTo (ruList rl, int32_t index, ptr *dest) |
| Returns the data payload of the element at given 0 based index. More...
|
|
This API is useful for scalar types such as int, long or bool.
Example of typed use:
bool b1 = false;
bool b2 = true;
bool vbool;
printf("%d\n", vbool);
}
printf("%s\n", vstr);
}
#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 ruIterTo(re, dest)
Returns the next element data in the given list to iterate over.
Definition: list.h:577
const char * perm_chars
A permanent NULL terminated string pointer.
Definition: regify-util.h:176
RUAPI ruType ruTypeBool(void)
Returns an ruType used for booleans.
RUAPI ruType ruTypeStrDup(void)
Returns an ruType used for transient strings.
◆ ruIterTo
Returns the next element data in the given list to iterate over.
- Parameters
-
re | Current list element to get the follower of. |
dest | Where the returned object will be stored as its given type. (casts added). |
- Returns
- 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.
◆ ruListIdxTo
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. |
dest | Where the returned object will be stored as its given type (without casts). |
- Returns
- 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.
◆ ruListPopTo
Return first element of the list.
- Parameters
-
rl | List to pop object from. |
dest | Optional. Where the returned object will be stored as its given type. (casts added) |
- Returns
- 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.
◆ ruListRemoveIdxTo
Remove and return the list element at index position from list.
- Parameters
-
rl | List to remove object from. |
index | 0(first)/-1(last) position of the element to remove in the list. |
dest | Optional. Where the returned object will be stored as its given type. (casts added) |
- Returns
- regify error code of this operation. RUE_OK on success RUE_USER_ABORT when a threaded list has quit else a regify error code.
◆ ruListRemoveTo
Remove and return the current list element from list.
- Parameters
-
rl | List to remove object from. |
rle | Element to remove, will be set to the previous element to allow for deletion during iteration. |
dest | Optional. Where the returned object will be stored as its given type. (casts added) |
- Returns
- regify error code of this operation. RUE_OK on success RUE_USER_ABORT when a threaded list has quit else a regify error code.
◆ ruListTryPopTo
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. |
dest | Optional. Where the returned object will be stored as its given type. (casts added) |
- Returns
- 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.
◆ ruListIdxDataTo()
RUAPI int32_t ruListIdxDataTo |
( |
ruList |
rl, |
|
|
int32_t |
index, |
|
|
ptr * |
dest |
|
) |
| |
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. |
dest | Where the returned object will be stored as its given type. |
- Returns
- 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.
◆ ruListNextDataTo()
Returns the data payload of the next list element.
- Parameters
-
re | Address of current list element to be updated with the next one. |
dest | Optional. Where the returned object will be stored as its given type. |
- Returns
- 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.
◆ ruListPopDataTo()
RUAPI int32_t ruListPopDataTo |
( |
ruList |
rl, |
|
|
ptr * |
dest |
|
) |
| |
Return first element of the list.
- Parameters
-
rl | List to pop object from. |
dest | Optional. Where the returned object will be stored as its given type. |
- Returns
- 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.
◆ ruListRemoveDataTo()
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. |
dest | Optional. Where the returned object will be stored as its given type. When not set object will be freed. |
- Returns
- regify error code of this operation. RUE_OK on success RUE_USER_ABORT when a threaded list has quit else a regify error code.
◆ ruListRemoveIdxDataTo()
RUAPI int32_t ruListRemoveIdxDataTo |
( |
ruList |
rl, |
|
|
int32_t |
index, |
|
|
ptr * |
dest |
|
) |
| |
Remove and return the list element at index position from list.
- Parameters
-
rl | List to remove object from. |
index | 0(first)/-1(last) position of the element to remove in the list. |
dest | Optional. Where the returned object will be stored as its given type. When not set object will be freed. |
- Returns
- regify error code of this operation. RUE_OK on success RUE_USER_ABORT when a threaded list has quit else a regify error code.
◆ ruListTryPopDataTo()
RUAPI int32_t ruListTryPopDataTo |
( |
ruList |
rl, |
|
|
msec_t |
timeoutMs, |
|
|
ptr * |
dest |
|
) |
| |
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. |
dest | Optional. Where the returned object will be stored as its given type. |
- Returns
- 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.