mdz_ansi_insertDoubleZerowed_async - maxdz-gmbh/mdz_string GitHub Wiki
Insert items in string until double-zerowed terminator ("\0\0"). String m_pData
and pItems cannot overlap, if reservation is allowed. Size
grows on inserted string length.
mdz_bool mdz_ansi_insertDoubleZerowed_async(
struct mdz_Ansi* pAnsi,
size_t nLeftPos,
const char* pcItems,
mdz_bool bReserve,
struct mdz_asyncData* pAsyncData);
Synchronous version:
mdz_ansi_insertDoubleZerowed(pAnsi, nLeftPos, pcItems, bReserve);
Parameter | Description |
---|---|
pAnsi |
pointer to string returned by mdz_ansi_create() or mdz_ansi_create_attached()
|
nLeftPos |
0-based position to insert. If nLeftPos == Size or -1, items are appended. nLeftPos > Size is not allowed |
pcItems |
items to insert |
bReserve |
if mdz_true reserve capacity when there is not enough space for insertion, otherwise mdz_false |
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 bReserve == mdz_true and memory allocation failed (MDZ_ERROR_ALLOCATION) |
mdz_false | if bReserve == mdz_true and there is not enough capacity for inserted data, but m_pData is attached using mdz_ansi_attachData() (MDZ_ERROR_ATTACHED) |
mdz_false | if bReserve == mdz_false and there is not enough free Capacity in the string (MDZ_ERROR_CAPACITY) |
mdz_true | if pcItems == NULL (MDZ_ERROR_ITEMS), or pcItems length id 0 (MDZ_ERROR_ZEROCOUNT), or nLeftPos > Size (MDZ_ERROR_BIGLEFT), or pcItems is too long (MDZ_ERROR_BIGCOUNT). No insertion is made |
mdz_true | insertion succeeded |