uwidth_max(3)
β¨ NAME β¨
uwidth_max β bestie, it's literally the number of bytes a character can occupy π and yes it lives in the Allegro game programming library π
π¦ SYNOPSIS π¦
#include <allegro.h>
int uwidth_max(int type);
πΈ DESCRIPTION πΈ
okay so picture this: you're deep in Unicode text data, right? uwidth_max is the low level helper function for exactly that vibe π«Ά
It returns the largest number of bytes that one single character can occupy in the given encoding format. Like, worst case scenario, how much room does one lil guy need? That's what she tells you β¨
And if you wanna talk about the format you're currently using, just pass U_CURRENT to represent the current format π no cap.
Example, because we love a demonstration:
char *temp_buffer = malloc(256 * uwidth_max(U_UTF8));
see how she ate that? allocating room for 256 characters worth of bytes, using the UTF-8 max width. iconic π
ngl this is a low level helper, so it's giving "building block" energy β it's not doing the encoding for you, she's just telling you the ceiling π
π SEE ALSO π
uwidth(3)ucwidth(3)
mwah π this has been the Allegro manual page for uwidth_max(3), brought to you by Allegro version 4.4.3 β stay slaying, go read uwidth(3) and ucwidth(3) next, and remember: one character, one byte budget, no regrets ππβ¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms