![]() |
Delta Chat Core C-API
|
An object containing a simple array. More...
#include <deltachat.h>
Public Member Functions | |
size_t | dc_array_get_cnt (const dc_array_t *array) |
Find out the number of items in an array. More... | |
uint32_t | dc_array_get_id (const dc_array_t *array, size_t index) |
Get the item at the given index as an ID. More... | |
void * | dc_array_get_ptr (const dc_array_t *array, size_t index) |
Get the item at the given index as an ID. More... | |
const uintptr_t * | dc_array_get_raw (const dc_array_t *array) |
Get raw pointer to the data. More... | |
uintptr_t | dc_array_get_uint (const dc_array_t *array, size_t index) |
Get the item at the given index as an unsigned integer. More... | |
void | dc_array_unref (dc_array_t *array) |
Free an array object. More... | |
An object containing a simple array.
This object is used in several places where functions need to return an array. The items of the array are typically IDs. To free an array object, use dc_array_unref().
size_t dc_array_get_cnt | ( | const dc_array_t * | array | ) |
Find out the number of items in an array.
array | The array object. |
uint32_t dc_array_get_id | ( | const dc_array_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 dc_array_get_cnt()-1. |
void * dc_array_get_ptr | ( | const dc_array_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 dc_array_get_cnt()-1. |
const uintptr_t * dc_array_get_raw | ( | const dc_array_t * | array | ) |
Get raw pointer to the data.
array | The array object. |
uintptr_t dc_array_get_uint | ( | const dc_array_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 dc_array_get_cnt()-1. |
void dc_array_unref | ( | dc_array_t * | array | ) |
Free an array object.
Does not free any data items.
array | The array object to free, created eg. by dc_get_chatlist(), dc_get_contacts() and so on. If NULL is given, nothing is done. |