mtext_character(3m17n)
π mtext_character β the m17n Library's lil character-hunter π
okay bestie, so this is a page from the m17n Library manual β mtext_character(3m17n) β and honestly? she's a baddie. she finds characters. that's it. that's the job. let's get into it β¨
πΈ SYNOPSIS πΈ
int mtext_character (MText * mt, int from, int to, int c)
like, that's the whole vibe right there. four args, one int coming back at ya. π
π¦ DESCRIPTION π¦
so basically: this function searches a character in an M-text. yeah. she's a searcher. π
mtext_character() looks through the M-text mt for the character c. cute, right? but here's the tea on direction, because it matters:
- if
fromis less thanto, the search starts at positionfromand goes forward β but it does not exceed(to - 1). - otherwise (so,
fromis not less thanto), the search starts at position(from - 1)and goes backward β but it does not exceedto.
and if you hand her an invalid position specification? she just treats it as both from and to being 0. no drama, no crash, she just quietly goes "aight, zeroes it is" π
β¨ RETURN VALUE β¨
okay so what do you get back:
- if
cis found,mtext_character()returns the position of its first occurrence. iconic. π - if it's not found, she returns
-1β and without changing the external variablemerror_code. no touching. she respects the variable's boundaries fr fr. - if an error is detected, she returns
-1and assigns an error code to the external variablemerror_code. π¨
π SEE ALSO π
go read these next, bestie, they're the sibling group chat:
mtext_chr()mtext_rchr()
π COPYRIGHT π
real talk, the legal bits, verbatim because we do NOT play with licensing:
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.
and that's the whole page, angel π«Ά go forth and find your characters. this was Version 1.8.4, dated Mon Sep 25 2023, and yeah β she ate. periodt. π β¨π
π¦ where this page comes from
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms