static int __vc_config_mgr_register_engine_config_updated_event(const char* path);
static int __vc_config_mgr_unregister_engine_config_updated_event();
+static int __vc_config_mgr_set_default_language(const char* language);
int __vc_config_mgr_print_engine_info();
int __vc_config_mgr_print_client_info();
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to get language");
}
- ret = vc_config_mgr_set_default_language(temp_lang);
+ ret = __vc_config_mgr_set_default_language(temp_lang);
if (0 != ret) {
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to set language");
} else {
return 0;
}
-int vc_config_mgr_set_default_language(const char* language)
+static int __vc_config_mgr_set_default_language(const char* language)
{
- pthread_mutex_lock(&vc_config_mgr_mutex);
if (0 >= g_slist_length(g_config_client_list)) {
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized");
- pthread_mutex_unlock(&vc_config_mgr_mutex);
return -1;
}
if (NULL == language) {
- pthread_mutex_unlock(&vc_config_mgr_mutex);
return -1;
}
if (NULL != g_config_info->language) {
if (0 != vc_parser_set_language(language)) {
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to save engine id");
- pthread_mutex_unlock(&vc_config_mgr_mutex);
return -1;
}
free(g_config_info->language);
g_config_info->language = strdup(language);
} else {
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] language is NULL");
- pthread_mutex_unlock(&vc_config_mgr_mutex);
return -1;
}
- pthread_mutex_unlock(&vc_config_mgr_mutex);
return 0;
}
+int vc_config_mgr_set_default_language(const char* language)
+{
+ pthread_mutex_lock(&vc_config_mgr_mutex);
+ int ret = __vc_config_mgr_set_default_language(language);
+ pthread_mutex_unlock(&vc_config_mgr_mutex);
+
+ return ret;
+}
+
int vc_config_mgr_get_enabled(bool* value)
{
pthread_mutex_lock(&vc_config_mgr_mutex);