TICKIT_STR...IMIT_BYTES(3)
β¨ TICKIT_STR...IMIT_BYTES(3) β¨
okay bestie, so this one's from the Library Functions Manual and it's literally the page about setting limit fields in string position counters. yes it's a mouthful, we'll get through it together π
πΈ NAME πΈ
tickit_stringpos_limit_... β set limit fields in string position counters
π SYNOPSIS π
#include <tickit.h>
void tickit_stringpos_limit_bytes(TickitStringPos *pos, size_t bytes);
void tickit_stringpos_limit_codepoints(TickitStringPos *pos, int codepoints);
void tickit_stringpos_limit_graphemes(TickitStringPos *pos, int graphemes);
void tickit_stringpos_limit_columns(TickitStringPos *pos, int columns);
void tickit_stringpos_limit_none(TickitStringPos *pos);
#define INIT_TICKIT_STRINGPOS_LIMIT_BYTES(bytes)
#define INIT_TICKIT_STRINGPOS_LIMIT_CODEPOINTS(codepoints)
#define INIT_TICKIT_STRINGPOS_LIMIT_GRAPHEMES(grahpemes)
#define INIT_TICKIT_STRINGPOS_LIMIT_COLUMNS(columns)
#define INIT_TICKIT_STRINGPOS_LIMIT_NONE
Link with -ltickit.
ngl that grahpemes typo in the macro is canon now, we do not touch it, we simply respect it π
π DESCRIPTION π
okay so the first four of these functions? each one sets one of the counter fields in pos to the value you hand it, and sets the other three to -1. and why do we care? because that's how you build a limit counter β the thing that makes tickit_utf8_count(3) or tickit_utf8_countmore(3) stop dead at whatever position you chose. it's giving β stop right there β energy.
the final function is the chill one: it just initialises all four fields to -1, no limits, no rules, free spirit π
each of them also exists as a macro, and the macros are the ones you want when you're initialising a brand new TickitStringPos variable. like:
TickitStringPos limit = INIT_TICKIT_STRINGPOS_LIMIT_BYTES(b);
see how clean that is?? main character variable declaration fr fr π
β RETURN VALUE β
the functions all return no value. like, none. zero. void queen π
the macros, though? they expand to a struct initialiser expression. so they're doing something, bestie, they're just doing it in expression form β¨
π¦ SEE ALSO π¦
and that's the whole page, no cap π«Ά shoutout to the TICKIT_STR...IMIT_BYTES(3) page in the Library Functions Manual for having us β ily, go read the SEE ALSO list, it's short but it ate π
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu jammy: libtickit-dev 0.4.1-1 Β· MIT
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms