-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.c
32 lines (28 loc) · 818 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "confuzzle.h"
/* This routine checks to make sure we are running on a Linux system
such as in a container. As a requriemnet for the class we are runnig on
Linux evironments so if you are using Windows or Mac you should be running in
a container */
void check_unix(){
FILE *f = popen("/usr/bin/uname", "r");
char data[512];
fgets(data,512,f);
pclose(f);
if(strcmp(data,"Linux\n")){
printf("This program must be run in a Linux environment\n");
exit(0);
}
}
int main(int argc, char **argv) {
printf("Hello World!!!\n");
check_unix();
if (argc < 2) {
printf("Specify student ID as a command line argument\n");
exit(0);
}
printf("Confuzzle executing, return value %i\n", confuzzle(argv[1]));
return 0;
}