al_ustr_newf(3)

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

πŸ’– NAME πŸ’–

al_ustr_newf β€” Allegro 5 API, hanging out in the Library Functions Manual (hi bestie πŸ’–).

🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

ALLEGRO_USTR *al_ustr_newf(const char *fmt, ...)

πŸŽ€ DESCRIPTION πŸŽ€

Okay so al_ustr_newf creates a new string using a printf-style format string. That's the whole main character move, and it ate. ✨

πŸ’… Notes πŸ’…

  • The %s specifier takes C string arguments, not ALLEGRO_USTRs. So if you wanna pass an ALLEGRO_USTR as a parameter, you literally must use al_cstr(3), and it must be NUL terminated. If the string contains an embedded NUL byte, everything from that byte onwards will be ignored. 😭
  • The %c specifier outputs a single byte, not the UTF-8 encoding of a code point. So it's only usable for ASCII characters (value <= 127) or if you really mean to output byte values from 128–255. To insert the UTF-8 encoding of a code point, encode it into a memory buffer using al_utf8_encode(3) then use the %s specifier. Remember to NUL terminate the buffer, bestie! 🧚

πŸ”₯ SEE ALSO πŸ”₯

al_ustr_new(3), al_ustr_appendf(3)


That's the vibe from the Allegro reference manual β€” al_ustr_newf(3), signing off πŸ’œ

πŸ“¦ 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