summaryrefslogtreecommitdiff
path: root/godwords.c
diff options
context:
space:
mode:
Diffstat (limited to 'godwords.c')
-rw-r--r--godwords.c38
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;
+}