Delta Chat Core C-API
|
An object containing a simple array. More...
#include <mrarray.h>
Public Member Functions | |
void | mrarray_unref (mrarray_t *array) |
Free an array object. More... | |
size_t | mrarray_get_cnt (const mrarray_t *array) |
Find out the number of items in an array. More... | |
uintptr_t | mrarray_get_uint (const mrarray_t *array, size_t index) |
Get the item at the given index as an unsigned integer. More... | |
uint32_t | mrarray_get_id (const mrarray_t *array, size_t index) |
Get the item at the given index as an ID. More... | |
void * | mrarray_get_ptr (const mrarray_t *array, size_t index) |
Get the item at the given index as an ID. More... | |
An object containing a simple array.
This object is used in several placed where functions need to return an array. The items of the array are typically IDs. To free an array object, use mrarray_unref().
void mrarray_unref | ( | mrarray_t * | array | ) |
Free an array object.
Does not free any data items.
array | The array object to free, created eg. by mrmailbox_get_chatlist(), mrmailbox_get_known_contacts() and so on. |
size_t mrarray_get_cnt | ( | const mrarray_t * | array | ) |
Find out the number of items in an array.
array | The array object. |
uintptr_t mrarray_get_uint | ( | const mrarray_t * | array, |
size_t | index | ||
) |
Get the item at the given index as an unsigned integer.
The size of the integer is always larget enough to hold a pointer.
array | The array object. |
index | Index of the item to get. Must be between 0 and mrarray_get_cnt()-1. |
uint32_t mrarray_get_id | ( | const mrarray_t * | array, |
size_t | index | ||
) |
Get the item at the given index as an ID.
array | The array object. |
index | Index of the item to get. Must be between 0 and mrarray_get_cnt()-1. |
void * mrarray_get_ptr | ( | const mrarray_t * | array, |
size_t | index | ||
) |
Get the item at the given index as an ID.
array | The array object. |
index | Index of the item to get. Must be between 0 and mrarray_get_cnt()-1. |