pack_ungetc(3)
π pack_ungetc β Allegro manual, bestie edition π
okay so real quick before anything: this is pack_ungetc(3) from the Allegro game programming library, and she is that girl. tiny function, big energy. let's get into it π«Ά
β¨ NAME β¨
pack_ungetc β moves one single character back to the input buffer. yeah. one. single. character. we'll get to why that word is doing heavy lifting here, Allegro game programming library girlies, this one's for you π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int pack_ungetc(int c, PACKFILE *f);
look at her. two args, one int, zero drama. the way that signature just works π
π¦ DESCRIPTION π¦
so basically, bestie, pack_ungetc puts a character back into the file's input buffer. you know how you read something and then you're like "wait, actually, no, put that back, i wasn't ready"? that's her. she's the undo button for one (1) character. iconic behaviour honestly π
and like with ungetc from libc, only a single push back is guaranteed. so don't be greedy and try to shove a whole vibe back in there β one character, one shot. no cap. β
note, and this one is important fr fr:pack_fgetsinternally usespack_ungetc, so never usepack_ungetcdirectly after usingpack_fgetson aPACKFILE. like, never. that's a collision, that's chaos, that's not the move. π this is the "two people showing up to the same party in the same outfit" of file I/O and one of them is gonna have a bad time π
π RETURN VALUE π
- returns
con success π₯³ slay, we love a successful push back - or
EOFon error π and that's the whole range, no in-between, no secret third thing
π SEE ALSO π
go read those too, they're all in the same friend group, iykyk π
and that's the whole page!! short, sweet, and lowkey essential. this was pack_ungetc(3) from Allegro, version 4.4.3 β mwah, sending you and your input buffer nothing but love, go forth and push back exactly one character, periodt π
β¨π§ββοΈ
π¦ 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