-
-
Notifications
You must be signed in to change notification settings - Fork 95
/
main.c
77 lines (63 loc) · 2.43 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <curl/curl.h>
#include <json-c/json_object.h>
#include <json-c/json_tokener.h>
#include "utils/defines.h"
#include <stdbool.h>
#include "src/init_config.h"
#include "src/functions.c"
#include "src/email.c"
#include "src/reminder.c"
#include "src/word_list.c"
#include "utils/defines.h"
#include <stdbool.h>
FILE *conffile;
char *HomeDir, *Mediaplay, *browser;
int retval = 0;
int len = 0;
int main()
{
if (!system("say --version 2>/dev/null")) {
strcpy(TTS,"say");
} else if (!system("espeak --version 2>/dev/null")) {
strcpy(TTS,"espeak -g 3");
} else {
printf("Could not find a text-to-speech program. Echoing messages to console");
strcpy(TTS,"echo");
}
conffile = get_Config_File();
HomeDir = set_HomeDir_Var(conffile);
Mediaplay = set_MediaPlayer_Var(conffile);
browser = set_WebBrowser_Var(conffile);
retval = config_Cleanup_Status(conffile);
/* Make sure initial configuration succeeded*/
if (!retval && HomeDir && Mediaplay && browser)
{
//Inform user about preferred media player, as to config file
char preferred_media_player[1000];
sprintf(preferred_media_player, "%s \"Your preferred media player is %s\" 2>/dev/null",TTS, Mediaplay);
system(preferred_media_player);
//Inform user about preferred web browser, as to config file
char preferred_webbrowser[1000];
sprintf(preferred_webbrowser, "%s \"Your preferred webbrowser is %s\" 2>/dev/null",TTS, browser);
system(preferred_webbrowser);
}
// pre-process words
fillWordList();
do
{
//---------------------------------------------------------------------------------------------------------------------
//Artificial Intelligence
#include "src/requests.c"
//Artificial Intelligence {REQUESTS}
#include "src/analysis.c"
//Artificial Intelligence {ANALYSIS}
#include "src/response.c"
//Artificial Intelligence {RESPONSE}
//---------------------------------------------------------------------------------------------------------------------
} while ((strcmp(str, "stop") != 0));
return 0;
}