Skip to content

mdz_utf32_attachData

Maksym Dzyubenko edited this page Feb 7, 2024 · 1 revision

Attach pre-allocated data to UTF-32 string, assigning pData to m_pData. If attached, m_pData will not be destroyed in mdz_utf32_destroy()

mdz_bool mdz_utf32_attachData(
  struct mdz_Utf32* pUtf32,
  uint32_t* pData,
  size_t nOffsetFromStart,
  size_t nCapacity,
  enum mdz_attach_type enAttachType,
  enum mdz_endianness enEndianness);

Parameter Description
pUtf32 pointer to string returned by mdz_utf32_create() or mdz_utf32_create_attached()
pData pointer to pre-allocated data to attach
nOffsetFromStart position in pre-allocated data to attach from. Can be > 0
nCapacity full capacity pre-allocated data in items
enAttachType type of attachment. 0 is expected at position pData[nOffsetFromStart] if MDZ_ATTACH_ZEROSIZE. 0 is expected at position pData[nCapacity] if MDZ_ATTACH_SIZE_TERMINATOR. MDZ_ATTACH_SIZE_NO_TERMINATOR is not allowed
enEndianness endianness of UTF-32 characters in pData. Can be MDZ_ENDIAN_LITTLE for "little-endian" or MDZ_ENDIAN_BIG for "big-endian"
Return Description
mdz_false if pUtf32 == NULL
mdz_false if pData == NULL (MDZ_ERROR_DATA), or nOffsetFromStart >= nCapacity (MDZ_ERROR_OFFSET), or invalid enAttachType (MDZ_ERROR_ATTACHTYPE), or invalid pData endianness (MDZ_ERROR_ENDIANNESS)
mdz_false if enAttachType is MDZ_ATTACH_ZEROSIZE or MDZ_ATTACH_SIZE_TERMINATOR but 0 is not found at expected position (MDZ_ERROR_ATTACH_TERMINATOR)
mdz_true operation succeeded
mdz_utf32 API Reference is generated using mdzApiRefGenerator.

mdz_string functions

mdz_ansi functions

mdz_utf8 functions

mdz_wchar functions

mdz_utf16 functions

mdz_utf32 functions

mdz_string API Reference is generated using mdzApiRefGenerator.
Clone this wiki locally