diff options
author | Rafael Marçalo <raroma09@gmail.com> | 2022-10-24 14:39:37 +0100 |
---|---|---|
committer | Rafael Marçalo <raroma09@gmail.com> | 2022-10-24 14:39:37 +0100 |
commit | 7e03a49d9876b4b6caf749533f29fbeebba47265 (patch) | |
tree | b9f337e1e7c517bf25b40ebd9c85c47e94619df0 /godwords.c | |
parent | a04983a91a70c909c83a7373274d1000ea5b7819 (diff) |
Diffstat (limited to 'godwords.c')
-rw-r--r-- | godwords.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/godwords.c b/godwords.c new file mode 100644 index 0000000..5b90cdf --- /dev/null +++ b/godwords.c @@ -0,0 +1,38 @@ +#include "session.h" +#include "utils.h" +#include <stdio.h> +#include <stdlib.h> + +int +main (int argc, char **argv) +{ + + FILE *dictionary = NULL; + + switch (argc) + { + case 1: + if (checkIfFileExists ("dictionary.dict") == 0) + { + dictionary = fopen ("dictionary.dict", "r"); + } + break; + case 2: + if (checkIfFileExists (argv[1]) == 0) + { + dictionary = fopen (argv[1], "r"); + } + } + + if (dictionary != NULL) + { + startSession (dictionary); + fclose (dictionary); + } + else + { + printf ("No Dictionary Found\n"); + } + + return 0; +} |