rtapi_app_exit(3rtapi)

πŸ’– rtapi_app_exit β€” the lil goodbye function πŸ’–

okay bestie, welcome to the 3rtapi manual page, HAL section, and no we are NOT skipping any of it 🫢


✨ NAME ✨

rtapi_app_exit β€” the user-provided function that shuts a component down. it's giving "pack your bags, we're leaving" energy πŸ‘‘


✨ SYNTAX ✨

#include <rtapi_app.h>

void rtapi_app_exit(void) {...}

literally the whole signature. that's it. slay πŸ’…


✨ ARGUMENTS ✨

None. not a single one. zero. the void takes no parameters πŸ•³οΈβœ¨


✨ DESCRIPTION ✨

so the body of rtapi_app_exit is written by the component author (that's you, main character 🌟), and usually it's a call to rtapi_exit or hal_exit, with other component-specific shutdown code happening before it. like, tidy up your own room before you call the moving truck, yk?

this code gets called when you unload a component that successfully initialized β€” meaning it returned zero from its rtapi_app_main. πŸŽ€

and no, it does NOT get called when the component didn't successfully initialize. if init flopped, this function never hears about it. the way that init failure just… never says bye 😭

✨ RETURN CODE ✨

None. nothing to return, nothing to report, just vibes ✨


✨ REALTIME CONSIDERATIONS ✨

the rtapi infrastructure calls this automatically, and it does so in an initialization context β€” which is not a realtime context. so lowkey don't go doing realtime things in here, okay? 🧚


✨ SEE ALSO ✨


and that's the whole page bestie, we ate and left no crumbs πŸ“

LinuxCNC Documentation Β· dated 2008-05-26 Β· rtapi_app_exit(3rtapi) β€” periodt. πŸ’œ