Update src/exithandle.c

This commit is contained in:
2026-08-11 21:07:10 +00:00
parent 7443de7152
commit eb17c19a60
+38
View File
@@ -0,0 +1,38 @@
// this code is licenced under Wrathmark licence
// © 2026 wullie wulliestudio.com
// please see attached licence for full usage and rights
#include "LocalHeader.h"
#include "stdWullie/exit.h"
#include "stdWullie/definitions/typeNull.h"
#include "stdWullie/namespaces/print.h"
#include "stdWullie/String/colours.h"
// exit not ment to be used in other programs
void exit(int code){
syscall1(SYS_exit, code);
for(;;){}
}
// safty last
// errors out with either an error message or generic, and exits
void safeError(char *error){
// if the user does provide an error message
if(error == NULL){
print.text(error);
print.colour("exiting program with code -1\n", RED);
exit(-1);
}
// if no error was provided
print.text("something went wrong: ");
print.colour("exiting with code -1\n", RED);
exit(-1);
}
// safty??
void riskyError(){
print.text("there was an error\n");
return;
}