Skip to content

mdz_ansi_alg_firstOf

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

Find first occurrence of any item of pcItems in string. 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_alg_firstOf(
  const char* pcData,
  size_t nLeftPos,
  size_t nRightPos,
  const char* pcItems,
  size_t nCount,
  enum mdz_error* penError);

Parameter Description
pcData pointer to string
nLeftPos 0-based end position to find up to. Use 0 to search till the beginning of string
nRightPos 0-based start position to find from right. Use Size-1 to search till the end of string
pcItems items to find. Cannot be NULL
nCount number of items to find. Cannot be 0
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_alg_init() or invalid
MDZ_ERROR_DATA pcData is NULL
MDZ_ERROR_ITEMS pcItems is NULL
MDZ_ERROR_ZERO_COUNT nCount is 0
MDZ_ERROR_BIG_RIGHT nRightPos is SIZE_MAX
MDZ_ERROR_BIG_LEFT nLeftPos > nRightPos
MDZ_ERROR_NONE function succeeded
Return Description
SIZE_MAX if no item of pcItems found or error happened
Result 0-based position of first match
mdz_ansi_alg API Reference is generated using mdzApiRefGenerator.