summaryrefslogtreecommitdiff
path: root/godwords.c
blob: 5b90cdf6724515c97351bcbe78de841f40578489 (plain)
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
33
34
35
36
37
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;
}