Compare commits

...

2 commits

Author SHA1 Message Date
array-in-a-matrix cf5ed43812 init file + basic os detection 2022-09-16 16:23:59 -04:00
array-in-a-matrix f801a68eb1 ignore testing files 2022-09-16 15:45:52 -04:00
2 changed files with 36 additions and 0 deletions

2
.gitignore vendored
View file

@ -52,3 +52,5 @@ Module.symvers
Mkfile.old
dkms.conf
# Testing files
test-*.c

34
pc-outro.c Normal file
View file

@ -0,0 +1,34 @@
#include <stdio.h>
#include "portaudio.h"
void shutdown(int os);
void main (void){
int os;
#ifdef _WIN32
os = 1;
#elif TARGET_OS_MAC
os = 2
#elif __linux__
os = 3;
#elif BSD
os = 4;
#else
os = 0;
#endif
printf("%d", os);
};
void shutdown(int os){
switch(os){
case 3:
// TODO: check init system; https://unix.stackexchange.com/questions/18209/detect-init-system-using-the-shell
system("shutdown -P now");
default:
printf("Error: Could not determine OS");
}
};