aa_autoinit(3)

πŸŽ€ aa_autoinit β€” the "just make it work bestie" init function πŸŽ€

okay so real talk: this is a page from the Library Functions Manual, and it's about aa_autoinit, which is genuinely the ✨ easy to use AA-lib initialization function ✨. The whole point of her is that you don't have to pick a driver yourself β€” she does the picking. Iconic behaviour, no notes. πŸ’…


🌸 SYNOPSIS 🌸

#include <aalib.h>

aa_context *aa_autoinit(const struct aa_hardware_params *params);

πŸ¦‹ PARAMETERS πŸ¦‹

  • const struct aa_hardware_params *params β€” the hardware parameters you actually want. Bestie, if you have no strong feelings (valid!), just pass aa_defparams and get the default values. She'll take it from there. 🫢

πŸ’– DESCRIPTION πŸ’–

So what does she do? She goes looking for an available output driver that supports the parameters you specified. πŸ’€βœ¨

The order matters, and here's the tea:

  1. First she attempts to initialize the recommended drivers. πŸ‘‘
  2. Then, in order, she goes through the drivers available in the aa_drivers array β€” which is literally all the regular output drivers compiled into AA-lib. 🌈

So like... she tries the good ones first, and then she just works her way down the list until something sticks. Main character energy fr fr. πŸ”₯


⭐ RETURNS ⭐

A pointer to the initialized context structure when successful β€” or NULL on failure. 😭 That's it. That's the whole vibe check. If you get NULL, something did not slay, and you should probably go look at your params. πŸ™ˆ

ngl NULL here means failure, not "no preference" β€” don't sleep on checking it.

πŸ’œ SEE ALSO πŸ’œ

the whole extended friend group, iykyk:

  • 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_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_parseoptions(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 🫢 this one got pulled together by c2man off aalib.h, dated 8 September 1999 β€” vintage fr, but the vibes are timeless. go forth and let her find you a driver. βœ¨πŸ‘‘