44 lines
905 B
C
44 lines
905 B
C
// this code is licenced under Wrathmark licence
|
|
// © 2026 wullie wulliestudio.com
|
|
// please see attached licence for full usage and rights
|
|
|
|
#include "stdWullie.h"
|
|
#include "localheader.h"
|
|
|
|
// generic functions that dont need a file of there own
|
|
|
|
// our own exit LINUX ONLY
|
|
void exit(int code){
|
|
syscall1(SYS_exit, code);
|
|
for(;;) {}
|
|
}
|
|
|
|
// safty last
|
|
void safeError(char *error){
|
|
if(error != NULL){
|
|
print(error);
|
|
ColorPrint("exiting with code -1\n", RED);
|
|
exit(-1);
|
|
}
|
|
|
|
print("something went wrong ");
|
|
ColorPrint("exiting with code -1\n", RED);
|
|
exit(-1);
|
|
}
|
|
|
|
// only use this when something will work but not as intended
|
|
void riskyError(){
|
|
print("not critical error was found\n");
|
|
}
|
|
|
|
|
|
// #Schlaf mein Kindlein, schlaf doch ein, der Rabe hat nach dir gerufen.#
|
|
void sleeper(long seconds){
|
|
timespec duration = {0};
|
|
duration.tv_sec = seconds;
|
|
|
|
syscall2(SYS_sleep, (long)(&duration), 0);
|
|
|
|
|
|
}
|