al_ustr_set_chr(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

✨ NAME ✨

al_ustr_set_chr β€” Allegro 5 API, coming at you from the Library Functions Manual πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro5/allegro.h>

size_t al_ustr_set_chr(ALLEGRO_USTR *us, int start_pos, int32_t c)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, here's the vibe: this function replaces the code point beginning at byte offset start_pos with c. πŸ’–

start_pos cannot be less than 0 β€” hard no, no cap.

If start_pos is past the end of us, then the space between the end of the string and start_pos gets padded with NUL ('\0') bytes. ✨

If start_pos is not the start of a valid code point, that's an error β€” and the string will be unmodified. The function does not mess with it, periodt. πŸ’€

On success, it returns the number of bytes written, i.e. the offset to the following code point. On error, it returns 0.

🌈 SEE ALSO 🌈


xoxo, source/version: Allegro reference manual πŸ’– β€” <al_ustr_set_chr>(3)>; date: not listed in the footer, so we're not inventing one, bestie 😭✨

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms