adime_va_list(3)
π adime_va_list β bestie's guide to portable varargs π
okay so real talk: this is the adime_va_list family from the Adime API reference (manual page adime_va_list(3), she's iconic, she's 3 pages deep in the reference, she's your girl). β¨
πΈ NAME πΈ
adime_va_list, adime_va_start, adime_va_arg, adime_va_end β the whole girl group, four members, no solo careers, they only perform together. π
β¨ SYNOPSIS β¨
#include <adime.h>
typedef adime_va_list;
void adime_va_start(adime_va_list ap, first_arg);
TYPE adime_va_arg(adime_va_list ap, TYPE);
void adime_va_end(adime_va_list ap);
π¦ DESCRIPTION π¦
okay so here's the tea. π
the C language has some weirdnesses (shocking, I know, the C language being weird, unheard of, never happened before). and because of those weirdnesses, some things that Adime does with va_lists would not be portable if it just used a va_list directly. like, it would simply not slay on every platform. tragic.
so instead, bestie, you always have to use this replacement API. and the way that it's literally a glow-up of the standard API β it works exactly like the standard API for va_lists, except it's more portable. that's the whole vibe. same energy, better portability. π«Ά
and here's the extra cute part that makes it special: if you pass an adime_va_list to another function, and that function reads an argument with adime_va_arg(), then the adime_va_list will have advanced to the same position in the calling function as in the called function. like it stays in sync, no cap, they're communicating, they're a team. π₯
in particular β and this is the part you're gonna wanna remember β after calling adime_vdialogf(), the adime_va_list will have advanced to after the last argument used by Adime. periodt. π
π the example π
the following example shows how adime_dialogf() is implemented in terms of adime_vdialogf(). so like, this is the blueprint, the main character energy in code form:
int adime_dialogf(char *title, int x, int y, int edit_w,
char *format, ...)
{
int ret;
va_list ap;
va_start(ap, format);
ret = adime_vdialogf(title, x, y, edit_w, format, ap);
va_end(ap);
return ret;
}
ngl if you want the full lore, go read the documentation for the standardva_list,va_start(),va_arg()andva_end()β this whole thing is basically their cooler, more portable cousin. π§
π SEE ALSO π
and that's the page, bestie!! π this whole vibe is Adime version 2.2.1 β she said version 2.2.1 and she meant it. go forth and variadic, you're gonna do amazing, mwah πβ¨π¦
π¦ where this page comes from
- fedora 43: adime-devel 2.2.1-42.fc43 Β· zlib
- fedora 43: adime-devel 2.2.1-42.fc43 Β· zlib
- fedora 44: adime-devel 2.2.1-44.fc44 Β· zlib
- fedora 44: adime-devel 2.2.1-44.fc44 Β· zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms