Update main.c

moved atexit() to setup
This commit is contained in:
SirTalksalot75 2024-04-23 15:27:11 +02:00 committed by GitHub
parent fafcb942e0
commit 520520e576
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 12 deletions

View File

@ -13,6 +13,16 @@ void notify_exit(void)
DEBUG("Exiting gemstone..."); DEBUG("Exiting gemstone...");
} }
/**
* @brief Closes File after compiling.
*
*/
void close_file(char file_to_close)
{
fclose(file_to_close);
}
/** /**
* @brief Run compiler setup here * @brief Run compiler setup here
* *
@ -31,27 +41,17 @@ void setup(void)
// actual setup // actual setup
DEBUG("finished starting up gemstone..."); DEBUG("finished starting up gemstone...");
} atexit(close_file(filename));
/**
* @brief Closes File after compiling.
*
*/
void close_file(char file_to_close)
{
fclose(file_to_close);
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
setup(); setup();
atexit(close_file(filename);
// Check for file input as argument // Check for file input as argument
if (2 != argc) if (2 != argc)
{ {
printf("Usage: %s <filename>\n", argv[0]); INFO("Usage: %s <filename>\n", argv[0]);
PANIC("No File could be found"); PANIC("No File could be found");
} }