mdz_ansi_reserveAndInit_async - maxdz-gmbh/mdz_string GitHub Wiki
Reserve nNewCapacity
items for string and initializes all items in cItem
. May be called only on empty string (with Size
== 0). After call, string Size
equals to Capacity-1.
Reservation is not made if m_pData
is attached using mdz_ansi_attachData()
and nNewCapacity
> Capacity
mdz_bool mdz_ansi_reserveAndInit_async(
struct mdz_Ansi* pAnsi,
size_t nNewCapacity,
char cItem,
struct mdz_asyncData* pAsyncData);
Synchronous version:
mdz_ansi_reserveAndInit(pAnsi, nNewCapacity, cItem);
Parameter | Description |
---|---|
pAnsi |
pointer to string returned by mdz_ansi_create() or mdz_ansi_create_attached()
|
nNewCapacity |
capacity to reserve in items |
cItem |
item for string initialization |
pAsyncData |
pointer to shared async data for asynchronous call, or NULL if call should be synchronous |
Return | Description |
---|---|
mdz_false | if pAnsi == NULL
|
mdz_false | if memory allocation failed (MDZ_ERROR_ALLOCATION) |
mdz_false | if Size > 0 (MDZ_ERROR_NONEMPTY) |
mdz_false | if nNewCapacity > Capacity and m_pData is attached using mdz_ansi_attachData() (MDZ_ERROR_ATTACHED) |
mdz_true | if nNewCapacity <= Capacity (MDZ_ERROR_CAPACITY), initialization succeeded |
mdz_true | reservation and initialization succeeded |