From 633f19627aa0bba5ed0ebd2d62bd4f546c178fce Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Tue, 20 Feb 2018 22:18:49 +0900 Subject: [PATCH] Add ttse_terminate Change-Id: I624fc2d5eb9110067c498aa97ebaf9b9d659ef7c Signed-off-by: sooyeon.kim (cherry picked from commit 6e21bfba20dfdbc91452488f190213a26d931eec) --- include/CMakeLists.txt | 1 + include/ttse_internal.h | 19 +++++++++++++++++++ packaging/tts.spec | 1 + server/ttsd_server.c | 13 +++++++++++++ server/ttsd_server.h | 2 ++ server/ttse.c | 8 ++++++++ 6 files changed, 44 insertions(+) create mode 100644 include/ttse_internal.h diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 8437a18..5d42c92 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -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 index 0000000..02054b5 --- /dev/null +++ b/include/ttse_internal.h @@ -0,0 +1,19 @@ +#ifndef __TTSE_INTERNAL_H__ +#define __TTSE_INTERNAL_H__ + +#include +#include "ttse.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int ttse_terminate(); + + +#ifdef __cplusplus +} +#endif + +#endif /* __TTSE_INTERNAL_H__ */ + diff --git a/packaging/tts.spec b/packaging/tts.spec index 7d09832..121f007 100644 --- a/packaging/tts.spec +++ b/packaging/tts.spec @@ -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 diff --git a/server/ttsd_server.c b/server/ttsd_server.c index f5c25c5..14dd166 100644 --- a/server/ttsd_server.c +++ b/server/ttsd_server.c @@ -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 */ diff --git a/server/ttsd_server.h b/server/ttsd_server.h index 89478b8..48862fc 100644 --- a/server/ttsd_server.h +++ b/server/ttsd_server.h @@ -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(); diff --git a/server/ttse.c b/server/ttse.c index bd7ed92..0f40802 100755 --- a/server/ttse.c +++ b/server/ttse.c @@ -23,6 +23,7 @@ #include #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) { -- 2.7.4