usetat(3)
β¨ NAME β¨
okay bestie, meet usetat(3) from the Allegro manual β it replaces a character in a string, and it's part of the Allegro game programming library. periodt. π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int usetat(char *s, int index, int c);
π¦ DESCRIPTION π¦
So like, usetat replaces the character at the specified index in the string with value c, and it handles any adjustments for variable width data β ie. if c encodes to a different width than the previous value at that location. It's giving byte-level awareness, no cap. β¨
If index is negative, it counts backward from the end of the string. Yes, backwards. Main character energy. π
Example:
usetat(text_string, 2, letter_a);
π RETURN VALUE π
It returns the number of bytes by which the trailing part of the string was moved. This is of interest only with text encoding formats where characters have a variable length, like UTF-8. So if you're in UTF-8 land, this number matters. Otherwise, it's just a little receipt. π§Ύ
lowkey important: variable-length encodings are the whole reason this return value exists, fr fr.
π₯ SEE ALSO π₯
This page was brought to you by Allegro, version 4.4.3, and it's the usetat(3) manual. stay byte-savvy, bestie ππ¦β¨
π¦ 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