aa_parseoptions(3)

πŸ’… aa_parseoptions πŸ’…

okay bestie, welcome to the aa_parseoptions page from the AA-lib manual β€” yes, the aa_parseoptions(3), Library Functions Manual, she's iconic, she's essential, and she's about to make your command line do tricks. πŸŽ€


✨ NAME ✨

aa_parseoptions β€” she parses the standard command line options used by AA-lib. that's the whole job. no notes. πŸ’–


🌸 SYNOPSIS 🌸

#include <aalib.h>

int aa_parseoptions
(
     struct aa_hardware_params *p,
     aa_renderparams *r,
     int *argc,
     char **argv
);

πŸ¦‹ PARAMETERS πŸ¦‹

  • struct aa_hardware_params *p β€” the hardware parameters structure you're gonna alter. the vibe is: you tweak this one, and then later you use it (with only the necessary modifications, no extra drama) to initialize the AA-lib context. πŸ’œ
  • aa_renderparams *r β€” the rendering parameters structure you're gonna alter. same energy: later you take this, with just the necessary modifications, and use it to render images. ✨
  • int *argc β€” literally just a pointer to the argc parameter that got passed to your main function. that's it, that's the whole thing. 🫢
  • char **argv β€” and this one's a pointer to the argv parameter passed to main. matching set, we love to see it. πŸ’…

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea, bestie. πŸ“

Use this function to parse the standard command line options used by AA-lib. Every single AA-lib program ought to call this function β€” like, it's not optional in spirit β€” because that's how you let the user specify some extra parameters of their own. main character energy for the user, honestly.

The function alters the aa_hardware_params and aa_renderparams structures, and it removes the known options from the argc/argv lists. (yes, it removes them. she takes what she needs and hands you back a tidier list. slay.) πŸ”₯

It also parses the AAOPTS environment variable. πŸ‘€

and when you call it with NULL for the argc/argv parameters, it parses AAOPTS only. so if you were wondering "can I just get the env var parsed" β€” yes ma'am, that's the move.

At least this call ought to be in every AA-lib program. periodt. πŸ’–


⭐ RETURNS ⭐

1 when successful and 0 on failure. πŸ’€

and if it fails? no biggie, the program can then print the help text that's chillin' in the aa_help variable. she's got you covered. 🌈


🌟 SEE ALSO 🌟

go read these too, they're all part of the friend group: save_d(3), mem_d(3), aa_help(3), aa_formats(3), aa_fonts(3), aa_dithernames(3), aa_drivers(3), aa_kbddrivers(3), aa_mousedrivers(3), aa_kbdrecommended(3), aa_mouserecommended(3), aa_displayrecommended(3), aa_defparams(3), aa_defrenderparams(3), aa_scrwidth(3), aa_scrheight(3), aa_mmwidth(3), aa_mmheight(3), aa_imgwidth(3), aa_imgheight(3), aa_image(3), aa_text(3), aa_attrs(3), aa_currentfont(3), aa_autoinit(3), aa_autoinitkbd(3), aa_autoinitmouse(3), aa_recommendhi(3), aa_recommendlow(3), aa_init(3), aa_initkbd(3), aa_initmouse(3), aa_close(3), aa_uninitkbd(3), aa_uninitmouse(3), aa_fastrender(3), aa_render(3), aa_puts(3), aa_printf(3), aa_gotoxy(3), aa_hidecursor(3), aa_showcursor(3), aa_getmouse(3), aa_hidemouse(3), aa_showmouse(3), aa_registerfont(3), aa_setsupported(3), aa_setfont(3), aa_getevent(3), aa_getkey(3), aa_resize(3), aa_resizehandler(3), aa_edit(3), aa_createedit(3), aa_editkey(3), aa_putpixel(3), aa_recommendhikbd(3), aa_recommendlowkbd(3), aa_recommendhimouse(3), aa_recommendlowmouse(3), aa_recommendhidisplay(3), aa_recommendlowdisplay(3). πŸ’œπŸ’œπŸ’œ


and that's the page, bestie!! πŸŽ€ generated by c2man from aalib.h, dated 8 September 1999 β€” yeah she's an old queen and she still ate, we love a vintage icon, aa_parseoptions(3) out. πŸ’…βœ¨