added function for notifying about exit

This commit is contained in:
Sven Vogel 2024-04-12 17:28:20 +02:00
parent f90ee70a8d
commit 4f30e6308d
1 changed files with 10 additions and 0 deletions

View File

@ -1,13 +1,23 @@
#include <stdlib.h>
#include <sys/log.h>
#include <yacc/parser.tab.h>
#define LOG_LEVEL LOG_LEVEL_DEBUG
void notify_exit(void)
{
DEBUG("Exiting gemstone...");
}
void setup(void)
{
log_init();
DEBUG("starting gemstone...");
#if LOG_LEVEL <= LOG_LEVEL_DEBUG
atexit(&notify_exit);
#endif
DEBUG("finished starting up gemstone...");
}