Skip to content

mdz_ansi_16_rfindSingle

Maksym Dzyubenko edited this page Oct 6, 2024 · 2 revisions

Find last occurrence of cItem. Returns 0-based position of match (if found), or SIZE_MAX if not found or error happened. If penError is not NULL, error will be written there

size_t mdz_ansi_16_rfindSingle(
  const mdz_Ansi16* psAnsi,
  size_t nLeftPos,
  size_t nRightPos,
  char cItem,
  enum mdz_error* penError);

Parameter Description
psAnsi pointer to string returned by mdz_ansi_16_attach()
nLeftPos 0-based end position to find up to. Use 0 to search till the beginning of Data
nRightPos 0-based start position to find from right. Use Size-1 to search from the end of Data
cItem character to find
penError if not NULL, error will be written there. There are following errors possible:
Value Description
MDZ_ERROR_LICENSE license is not initialized using mdz_ansi_16_init() or invalid
MDZ_ERROR_DATA psAnsi is NULL
MDZ_ERROR_CAPACITY Capacity is too large
MDZ_ERROR_BIG_SIZE Size > Capacity
MDZ_ERROR_TERMINATOR there is no 0-terminator on Data[Size] position
MDZ_ERROR_BIG_RIGHT nRightPos >= Size
MDZ_ERROR_BIG_LEFT nLeftPos > nRightPos
MDZ_ERROR_NONE function succeeded
Return Description
SIZE_MAX if cItem not found or error happened
Result 0-based position of first match
mdz_ansi_16 API Reference is generated using mdzApiRefGenerator.