uinsert(3alleg4)
π uinsert β bestie edition π
okay so real talk, this is uinsert from the Allegro manual, section 3alleg4, and it's a function from the Allegro game programming library. she's a little string-surgery icon and honestly? she eats. π¦
β¨ NAME β¨
uinsert β inserts a character in a string. Allegro game programming library. no cap, that's the whole job description. π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int uinsert(char *s, int index, int c);
three args, one int coming back at you. slay. π
π DESCRIPTION π
so here's the vibe: uinsert takes your character c and slides her into the string s at the specified index. and because she's polite, she shoves the rest of the data along to make room. like scooting over on the couch so everyone fits. π
and if index is negative? not a problem, she counts backward from the end of the string. negative index energy, we love to see it. π
example time, bestie:
uinsert(text_string, 0, prefix_letter);
that's her putting prefix_letter at the very front, index zero, main character position. β¨
π₯ RETURN VALUE π₯
she hands you back the number of bytes by which the trailing part of the string was moved. so like, how far everything had to scooch. useful for knowing how much got shuffled. π
π«Ά SEE ALSO π«Ά
the whole string-girlie friend group. go say hi. π
okay that's the whole page, mwah π this was Allegro version 4.4.3, uinsert(3alleg4), and yes she's iconic, periodt. ππβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms