Add ttse_terminate 62/171262/1
authorsooyeon.kim <sooyeon.kim@samsung.com>
Tue, 20 Feb 2018 13:18:49 +0000 (22:18 +0900)
committerSooyeon Kim <sooyeon.kim@samsung.com>
Wed, 28 Feb 2018 02:45:19 +0000 (02:45 +0000)
Change-Id: I624fc2d5eb9110067c498aa97ebaf9b9d659ef7c
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
(cherry picked from commit 6e21bfba20dfdbc91452488f190213a26d931eec)

include/CMakeLists.txt
include/ttse_internal.h [new file with mode: 0644]
packaging/tts.spec
server/ttsd_server.c
server/ttsd_server.h
server/ttse.c

index 8437a18..5d42c92 100644 (file)
@@ -11,3 +11,4 @@ INSTALL(FILES "${CMAKE_BINARY_DIR}/include/tts.h" DESTINATION ${INCLUDEDIR})
 INSTALL(FILES "${CMAKE_BINARY_DIR}/include/tts_internal.h" DESTINATION ${INCLUDEDIR})
 INSTALL(FILES "${CMAKE_BINARY_DIR}/include/tts_setting.h" DESTINATION ${INCLUDEDIR})
 INSTALL(FILES "${CMAKE_BINARY_DIR}/include/ttse.h" DESTINATION ${INCLUDEDIR})
+INSTALL(FILES "${CMAKE_BINARY_DIR}/include/ttse_internal.h" DESTINATION ${INCLUDEDIR})
diff --git a/include/ttse_internal.h b/include/ttse_internal.h
new file mode 100644 (file)
index 0000000..02054b5
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __TTSE_INTERNAL_H__
+#define __TTSE_INTERNAL_H__
+
+#include <tizen.h>
+#include "ttse.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int ttse_terminate();
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TTSE_INTERNAL_H__ */
+
index 7d09832..121f007 100644 (file)
@@ -136,3 +136,4 @@ mkdir -p %{TZ_SYS_RO_SHARE}/voice/test
 %defattr(-,root,root,-)
 %{_libdir}/pkgconfig/tts-engine.pc
 %{_includedir}/ttse.h
+%{_includedir}/ttse_internal.h
index f5c25c5..14dd166 100644 (file)
@@ -473,6 +473,19 @@ int ttsd_finalize()
        return TTSD_ERROR_NONE;
 }
 
+int ttsd_terminate()
+{
+       SLOG(LOG_INFO, tts_tag(), "[Server] Terminate");
+
+       ttsd_terminate_daemon(NULL);
+
+       ttsd_dbus_close_connection();
+       ttsd_network_finalize();
+       ttsd_finalize();
+
+       return TTSD_ERROR_NONE;
+}
+
 /*
 * TTS Server Functions for Client
 */
index 89478b8..48862fc 100644 (file)
@@ -31,6 +31,8 @@ int ttsd_initialize(ttse_request_callback_s *callback);
 
 int ttsd_finalize();
 
+int ttsd_terminate();
+
 Eina_Bool ttsd_cleanup_client(void *data);
 
 Eina_Bool ttsd_get_daemon_exist();
index bd7ed92..0f40802 100755 (executable)
@@ -23,6 +23,7 @@
 #include <Ecore.h>
 
 #include "ttse.h"
+#include "ttse_internal.h"
 
 static ttsd_mode_e g_tts_mode = TTSD_MODE_DEFAULT;
 
@@ -114,6 +115,13 @@ int ttse_main(int argc, char** argv, ttse_request_callback_s *callback)
        return TTSE_ERROR_NONE;
 }
 
+int ttse_terminate()
+{
+       ttsd_terminate();
+
+       return TTSE_ERROR_NONE;
+}
+
 int ttse_get_speed_range(int* min, int* normal, int* max)
 {
        if (NULL == min || NULL == normal || NULL == max) {