tizen beta release
[platform/core/uifw/stt.git] / server / sttd_main.c
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
3 *  Licensed under the Apache License, Version 2.0 (the "License");
4 *  you may not use this file except in compliance with the License.
5 *  You may obtain a copy of the License at
6 *  http://www.apache.org/licenses/LICENSE-2.0
7 *  Unless required by applicable law or agreed to in writing, software
8 *  distributed under the License is distributed on an "AS IS" BASIS,
9 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 *  See the License for the specific language governing permissions and
11 *  limitations under the License.
12 */
13
14
15 #include "sttd_main.h"
16 #include "sttd_server.h"
17 #include "sttd_network.h"
18 #include "sttd_dbus.h"
19
20 #include <Ecore.h>
21
22 int main(int argc, char** argv)
23 {
24         SLOG(LOG_DEBUG, TAG_STTD, "  ");
25         SLOG(LOG_DEBUG, TAG_STTD, "  ");
26         SLOG(LOG_DEBUG, TAG_STTD, "===== STT Daemon Initialize");
27
28         if (0 != sttd_initialize()) {
29                 SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to initialize stt-daemon"); 
30                 return EXIT_FAILURE;
31         }
32
33         if (0 != sttd_dbus_open_connection()) {
34                 SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to open connection");
35                 return EXIT_FAILURE;
36         }
37
38         sttd_network_initialize();
39
40         printf("stt-daemon start...\n");
41
42         SLOG(LOG_DEBUG, TAG_STTD, "[Main] stt-daemon start..."); 
43
44         SLOG(LOG_DEBUG, TAG_STTD, "=====");
45         SLOG(LOG_DEBUG, TAG_STTD, "  ");
46         SLOG(LOG_DEBUG, TAG_STTD, "  ");
47
48         ecore_main_loop_begin();
49
50         ecore_shutdown();
51
52         sttd_dbus_close_connection();
53
54         sttd_network_finalize();
55
56         return 0;
57 }
58
59
60