#include "voice_control_common.h"
#include "voice_control_key_defines.h"
+static pthread_mutex_t g_cmd_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t g_cmd_list_mutex = PTHREAD_MUTEX_INITIALIZER;
+#define CMD_MUTEX_LOCK() pthread_mutex_lock(&g_cmd_mutex)
+#define CMD_MUTEX_UNLOCK() pthread_mutex_unlock(&g_cmd_mutex)
+#define CMD_LIST_MUTEX_LOCK() pthread_mutex_lock(&g_cmd_list_mutex)
+#define CMD_LIST_MUTEX_UNLOCK() pthread_mutex_unlock(&g_cmd_list_mutex)
+
static int g_feature_enabled = -1;
+static bool g_privilege_allowed = false;
-static int g_privilege_allowed = 1; /* Always True */
+static pthread_mutex_t g_cynara_mutex = PTHREAD_MUTEX_INITIALIZER;
static cynara *p_cynara = NULL;
+static GList *g_cmd_list = NULL;
+static GList *g_cmdlist_list = NULL;
+
// For getting timestamp using regular expression
static regex_t reg[MAX_NUM_REGEX];
}
}
- return 0;
+ return VC_ERROR_NONE;
}
static int __check_privilege_initialize()
char smack_label[1024] = {'\0',};
if (!p_cynara) {
- return false;
+ return false;
}
fp = fopen(label_path, "r");
if (fp != NULL) {
- if (fread(smack_label, 1, sizeof(smack_label), fp) <= 0)
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] fail to fread");
+ if (0 >= fread(smack_label, 1, sizeof(smack_label), fp))
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] fail to fread");
- fclose(fp);
+ fclose(fp);
}
pid_t pid = getpid();
int ret = cynara_check(p_cynara, smack_label, session, uid, privilege);
SLOG(LOG_DEBUG, TAG_VCCMD, "[Client]cynara_check returned %d(%s)", ret, (CYNARA_API_ACCESS_ALLOWED == ret) ? "Allowed" : "Denied");
if (session)
- free(session);
+ free(session);
if (ret != CYNARA_API_ACCESS_ALLOWED)
- return false;
+ return false;
return true;
}
static void __check_privilege_deinitialize()
{
if (p_cynara)
- cynara_finish(p_cynara);
+ {
+ int ret = cynara_finish(p_cynara);
+ if (ret != CYNARA_API_SUCCESS)
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] cynara finish %d", ret);
+ }
p_cynara = NULL;
}
static int __vc_cmd_check_privilege()
{
- char uid[16];
+ if (true == g_privilege_allowed)
+ return VC_ERROR_NONE;
- if (0 == g_privilege_allowed) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Permission is denied");
- return VC_ERROR_PERMISSION_DENIED;
- } else if (-1 == g_privilege_allowed) {
- if (false == __check_privilege_initialize()) {
+ pthread_mutex_lock(&g_cynara_mutex);
+
+ if (false == g_privilege_allowed) {
+ bool ret = true;
+ ret = __check_privilege_initialize();
+ if (false == ret) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] privilege initialize is failed");
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
return VC_ERROR_PERMISSION_DENIED;
}
- snprintf(uid, 16, "%d", getuid());
- if (false == __check_privilege(uid, VC_PRIVILEGE)) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Permission is denied");
- g_privilege_allowed = 0;
+
+ char uid[32];
+ snprintf(uid, 32, "%d", getuid());
+ ret = true;
+ ret = __check_privilege(uid, VC_PRIVILEGE_RECORDER);
+ if (false == ret) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Permission is denied(%s)(%s)", VC_PRIVILEGE_RECORDER, uid);
__check_privilege_deinitialize();
+ g_privilege_allowed = false;
+ pthread_mutex_unlock(&g_cynara_mutex);
return VC_ERROR_PERMISSION_DENIED;
+ //LCOV_EXCL_STOP
}
+
__check_privilege_deinitialize();
}
- g_privilege_allowed = 1;
-
+ g_privilege_allowed = true;
+ pthread_mutex_unlock(&g_cynara_mutex);
return VC_ERROR_NONE;
}
return VC_ERROR_PERMISSION_DENIED;
}
+ CMD_LIST_MUTEX_LOCK();
+
if (NULL == vc_cmd_list) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
+ CMD_LIST_MUTEX_UNLOCK();
return VC_ERROR_INVALID_PARAMETER;
}
if (NULL == list) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Not enough memory");
+ CMD_LIST_MUTEX_UNLOCK();
return VC_ERROR_OUT_OF_MEMORY;
}
*vc_cmd_list = (vc_cmd_list_h)list;
+ g_cmdlist_list = g_list_append(g_cmdlist_list, list);
+
SLOG(LOG_DEBUG, TAG_VCCMD, "[List] list(%p)", *vc_cmd_list);
+ CMD_LIST_MUTEX_UNLOCK();
return VC_ERROR_NONE;
}
return VC_ERROR_PERMISSION_DENIED;
}
+ CMD_LIST_MUTEX_LOCK();
+
if (NULL == vc_cmd_list) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
+ CMD_LIST_MUTEX_UNLOCK();
return VC_ERROR_INVALID_PARAMETER;
}
- vc_cmd_list_remove_all(vc_cmd_list, release_command);
vc_cmd_list_s* list = NULL;
list = (vc_cmd_list_s*)vc_cmd_list;
SLOG(LOG_DEBUG, TAG_VCCMD, "[List] list(%p)", list);
- if (NULL != list) {
- free(list);
- list = NULL;
+ GList *iter = NULL;
+ iter = g_list_find(g_cmdlist_list, list);
+ if (NULL == iter) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "Fail to destroy client : handle is not valid");
+ CMD_LIST_MUTEX_UNLOCK();
+ return VC_ERROR_INVALID_PARAMETER;
}
+ g_cmdlist_list = g_list_delete_link(g_cmdlist_list, iter);
+
+ vc_cmd_list_remove_all((vc_cmd_list_h)list, release_command);
+ free(list);
+ list = NULL;
+
+ SLOG(LOG_DEBUG, TAG_VCCMD, "Client destroy");
+
+ CMD_LIST_MUTEX_UNLOCK();
return VC_ERROR_NONE;
}
SLOG(LOG_DEBUG, TAG_VCCMD, "[List] list(%p), command(%p)", list, cmd);
- vc_cmd_s* temp_cmd = NULL;
GSList *iter = NULL;
-
- iter = g_slist_nth(list->list, 0);
-
- while (NULL != iter) {
- temp_cmd = iter->data;
-
- if (NULL != temp_cmd && cmd == temp_cmd) {
- list->list = g_slist_remove(list->list, temp_cmd);
- /*
- if (true == release_command) {
- SLOG(LOG_DEBUG, TAG_VCCMD, "Release command data");
- if (NULL != temp_cmd->command) free(temp_cmd->command);
- if (NULL != temp_cmd->parameter) free(temp_cmd->parameter);
- free(temp_cmd);
- temp_cmd = NULL;
- }
- */
- }
-
- iter = g_slist_next(iter);
+ iter = g_slist_find(list->list, cmd);
+ if (NULL == iter) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "Fail to destroy command : handle is not valid");
+ return VC_ERROR_INVALID_PARAMETER;
}
- int count = g_slist_length(list->list);
+ list->list = g_slist_remove_link(list->list, iter);
+ SLOG(LOG_DEBUG, TAG_VCCMD, "destroy command");
- if (0 == count) {
+ int len = g_slist_length(list->list);
+ if (0 == len)
list->index = -1;
- } else if (list->index == count) {
- list->index = count - 1;
- }
+ else if (list->index == len)
+ list->index = len - 1;
return VC_ERROR_NONE;
}
+static void __vc_cmd_list_remove_all_foreach(gpointer data)
+{
+ vc_cmd_s *temp = (vc_cmd_s *)data;
+ if (temp) {
+ SECURE_SLOG(LOG_DEBUG, TAG_VCCMD, "Free command(%p)", temp);
+ vc_cmd_destroy((vc_cmd_h)temp);
+ }
+}
+
int vc_cmd_list_remove_all(vc_cmd_list_h vc_cmd_list, bool release_command)
{
if (0 != __vc_cmd_get_feature_enabled()) {
return VC_ERROR_PERMISSION_DENIED;
}
- SLOG(LOG_DEBUG, TAG_VCCMD, "===== Destroy all command");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Destroy all command");
if (NULL == vc_cmd_list) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
return VC_ERROR_INVALID_PARAMETER;
}
- vc_cmd_list_s* list = NULL;
- list = (vc_cmd_list_s*)vc_cmd_list;
+ vc_cmd_list_s* cmd_list = (vc_cmd_list_s*)vc_cmd_list;
SLOG(LOG_DEBUG, TAG_VCCMD, "[List] list (%p), release command (%s)"
- , list, release_command ? "true" : "false");
-
- int count = g_slist_length(list->list);
-
- int i ;
- vc_cmd_s *temp_cmd;
+ , cmd_list, release_command ? "true" : "false");
- for (i = 0; i < count ; i++) {
- temp_cmd = g_slist_nth_data(list->list, 0);
-
- if (NULL != temp_cmd) {
- list->list = g_slist_remove(list->list, temp_cmd);
+ if (NULL == cmd_list->list) {
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ List is already empty.");
+ return VC_ERROR_NONE;
+ }
- if (true == release_command) {
- SLOG(LOG_DEBUG, TAG_VCCMD, "Free command(%p)", temp_cmd);
- if (NULL != temp_cmd->command) free(temp_cmd->command);
- if (NULL != temp_cmd->parameter) free(temp_cmd->parameter);
- if (NULL != temp_cmd->appid) free(temp_cmd->appid);
- if (NULL != temp_cmd->invocation_name) free(temp_cmd->invocation_name);
- if (NULL != temp_cmd->fixed) free(temp_cmd->fixed);
- free(temp_cmd);
- temp_cmd = NULL;
- }
- }
+ if (true == release_command) {
+ g_slist_free_full(cmd_list->list, __vc_cmd_list_remove_all_foreach);
+ } else {
+ g_slist_free(cmd_list->list);
}
- list->list = NULL;
- list->index = -1;
- SLOG(LOG_DEBUG, TAG_VCCMD, "=====");
- SLOG(LOG_DEBUG, TAG_VCCMD, " ");
+ cmd_list->list = NULL;
+ cmd_list->index = -1;
+
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@");
return VC_ERROR_NONE;
}
return VC_ERROR_PERMISSION_DENIED;
}
- if (NULL == vc_cmd_list) {
+ if (NULL == vc_cmd_list || NULL == callback) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
return VC_ERROR_INVALID_PARAMETER;
}
vc_cmd_list_s* list = NULL;
list = (vc_cmd_list_s*)vc_cmd_list;
- int count = g_slist_length(list->list);
- int i ;
-
GSList *iter = NULL;
- vc_cmd_s *temp_cmd;
-
iter = g_slist_nth(list->list, 0);
-
- for (i = 0; i < count; i++) {
- if (NULL == iter) {
+ while (NULL != iter) {
+ vc_cmd_s *temp_cmd = NULL;
+ temp_cmd = iter->data;
+ if (NULL == temp_cmd) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] No command in list");
return VC_ERROR_OPERATION_FAILED;
}
+ if (false == callback((vc_cmd_h)temp_cmd, user_data))
+ break;
- temp_cmd = iter->data;
-
- if (NULL != temp_cmd) {
- if (false == callback((vc_cmd_h)temp_cmd, user_data)) {
- break;
- }
-
- }
iter = g_slist_next(iter);
}
- SLOG(LOG_DEBUG, TAG_VCCMD, "===== Foreach commands Done");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Foreach commands Done");
return VC_ERROR_NONE;
}
int vc_cmd_list_filter_by_type(vc_cmd_list_h original, int type, vc_cmd_list_h* filtered)
{
- SLOG(LOG_DEBUG, TAG_VCCMD, "===== Filter by type");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Filter by type");
if (0 != __vc_cmd_get_feature_enabled()) {
return VC_ERROR_NOT_SUPPORTED;
return VC_ERROR_PERMISSION_DENIED;
}
- if (NULL == original) {
+ if (NULL == original || NULL == filtered) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
return VC_ERROR_INVALID_PARAMETER;
}
return VC_ERROR_OPERATION_FAILED;
}
- int count = g_slist_length(list->list);
- int i;
-
GSList *iter = NULL;
- vc_cmd_s *iter_cmd;
-
iter = g_slist_nth(list->list, 0);
-
- for (i = 0; i < count; i++) {
- if (NULL == iter) {
+ while (NULL != iter) {
+ vc_cmd_s *iter_cmd = NULL;
+ iter_cmd = iter->data;
+ if (NULL == iter_cmd) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] No command in list");
return VC_ERROR_OPERATION_FAILED;
}
- if (NULL != iter->data) {
- iter_cmd = iter->data;
-
- if (NULL != iter_cmd) {
- int iter_type;
- if (0 != vc_cmd_get_type((vc_cmd_h)iter_cmd, &iter_type)) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Fail to get command type");
- continue;
- }
- if (iter_type == type) {
- vc_cmd_h temp_cmd;
- if (0 != vc_cmd_create(&temp_cmd)) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Fail to create cmd");
- continue;
- }
-
- memcpy(temp_cmd, iter_cmd, sizeof(vc_cmd_s));
- if (NULL != iter_cmd->command) {
- ((vc_cmd_s*)temp_cmd)->command = strdup(iter_cmd->command);
- }
- if (NULL != iter_cmd->parameter) {
- ((vc_cmd_s*)temp_cmd)->parameter = strdup(iter_cmd->parameter);
- }
-
- if (0 != vc_cmd_list_add(temp_list, temp_cmd)) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Fail to cmd list add");
- vc_cmd_destroy(temp_cmd);
- continue;
- }
- }
+ int iter_type = 0;
+ if (0 != vc_cmd_get_type((vc_cmd_h)iter_cmd, &iter_type)) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Fail to get command type");
+ continue;
+ }
+
+ if (iter_type == type) {
+ vc_cmd_h temp_cmd;
+ if (0 != vc_cmd_create(&temp_cmd)) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Fail to create cmd");
+ continue;
+ }
+
+ memcpy(temp_cmd, iter_cmd, sizeof(vc_cmd_s));
+ if (NULL != iter_cmd->command)
+ ((vc_cmd_s *)temp_cmd)->command = strdup(iter_cmd->command);
+ if (NULL != iter_cmd->parameter)
+ ((vc_cmd_s *)temp_cmd)->parameter = strdup(iter_cmd->parameter);
+
+ if (0 != vc_cmd_list_add(temp_list, temp_cmd)) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Fail to cmd list add");
+ vc_cmd_destroy(temp_cmd);
+ continue;
}
}
iter = g_slist_next(iter);
}
- count = 0;
+ int count = 0;
if (0 != vc_cmd_list_get_count(temp_list, &count)) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Fail to get count");
} else {
*filtered = temp_list;
- SLOG(LOG_DEBUG, TAG_VCCMD, "=====");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@");
return VC_ERROR_NONE;
}
list = (vc_cmd_list_s*)vc_cmd_list;
int count = g_slist_length(list->list);
+ if (0 == count) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] List is empty");
+ return VC_ERROR_EMPTY;
+ }
if (list->index < count - 1) {
list->index = list->index + 1;
vc_cmd_list_s* list = NULL;
list = (vc_cmd_list_s*)vc_cmd_list;
+ if (0 == g_slist_length(list->list)) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] List is empty");
+ return VC_ERROR_EMPTY;
+ }
+
if (list->index > 0) {
list->index = list->index - 1;
SLOG(LOG_DEBUG, TAG_VCCMD, "[DEBUG] List index : %d", list->index);
return VC_ERROR_PERMISSION_DENIED;
}
+ CMD_MUTEX_LOCK();
+
if (NULL == vc_command) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
+ CMD_MUTEX_UNLOCK();
return VC_ERROR_INVALID_PARAMETER;
}
if (NULL == command) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Not enough memory");
+ CMD_MUTEX_UNLOCK();
return VC_ERROR_OUT_OF_MEMORY;
}
command->invocation_name = NULL;
command->appid = NULL;
command->fixed = NULL;
+ command->coordinates = NULL;
*vc_command = (vc_cmd_h)command;
+ g_cmd_list = g_list_append(g_cmd_list, command);
+
SLOG(LOG_DEBUG, TAG_VCCMD, "[Create command][%p]", *vc_command);
+ CMD_MUTEX_UNLOCK();
return VC_ERROR_NONE;
}
return VC_ERROR_PERMISSION_DENIED;
}
+ CMD_MUTEX_LOCK();
+
if (NULL == vc_command) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
+ CMD_MUTEX_UNLOCK();
return VC_ERROR_INVALID_PARAMETER;
}
SLOG(LOG_DEBUG, TAG_VCCMD, "[Destroy command][%p]", command);
- if (NULL != command) {
- if (NULL != command->command) {
- free(command->command);
- command->command = NULL;
- }
- if (NULL != command->parameter) {
- free(command->parameter);
- command->parameter = NULL;
- }
- if (NULL != command->invocation_name) {
- free(command->invocation_name);
- command->invocation_name = NULL;
- }
- if (NULL != command->appid) {
- free(command->appid);
- command->appid = NULL;
- }
- if (NULL != command->fixed) {
- free(command->fixed);
- command->fixed = NULL;
- }
- free(command);
- command = NULL;
+ GList *iter = NULL;
+ iter = g_list_find(g_cmd_list, command);
+ if (NULL == iter) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "Fail to command destroy : handle is not valid");
+ CMD_MUTEX_UNLOCK();
+ return VC_ERROR_INVALID_PARAMETER;
}
+ g_cmd_list = g_list_delete_link(g_cmd_list, iter);
+
+ if (command->command)
+ free(command->command);
+ command->command = NULL;
+ if (command->parameter)
+ free(command->parameter);
+ command->parameter = NULL;
+ if (command->invocation_name)
+ free(command->invocation_name);
+ command->invocation_name = NULL;
+ if (command->appid)
+ free(command->appid);
+ command->appid = NULL;
+ if (command->fixed)
+ free(command->fixed);
+ command->fixed = NULL;
+ if (command->coordinates)
+ free(command->coordinates);
+ command->coordinates = NULL;
+ free(command);
+ command = NULL;
+
+ CMD_MUTEX_UNLOCK();
return VC_ERROR_NONE;
}
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd) {
- cmd->id = id;
- SLOG(LOG_DEBUG, TAG_VCCMD, "[Set id][%p] id(%d)", vc_command, cmd->id);
- }
+ cmd->id = id;
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[Set id][%p] id(%d)", vc_command, cmd->id);
- return 0;
+ return VC_ERROR_NONE;
}
+//LCOV_EXCL_START
int vc_cmd_get_id(vc_cmd_h vc_command, int* id)
{
if (0 != __vc_cmd_get_feature_enabled()) {
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd) {
- *id = cmd->id;
- SLOG(LOG_DEBUG, TAG_VCCMD, "[Get id][%p] id(%d)", vc_command, *id);
- }
+ *id = cmd->id;
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[Get id][%p] id(%d)", vc_command, *id);
- return 0;
+ return VC_ERROR_NONE;
}
+//LCOV_EXCL_STOP
int vc_cmd_set_appid(vc_cmd_h vc_command, const char* appid)
{
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->appid) {
+ if (cmd->appid)
free(cmd->appid);
- cmd->appid = NULL;
- }
-
+ cmd->appid = NULL;
cmd->appid = strdup(appid);
SLOG(LOG_DEBUG, TAG_VCCMD, "[Set appid][%p] appid(%s)", vc_command, cmd->appid);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_get_appid(vc_cmd_h vc_command, char** appid)
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->appid) {
+ if (cmd->appid)
*appid = strdup(gettext(cmd->appid));
- }
+ else
+ *appid = NULL;
SLOG(LOG_DEBUG, TAG_VCCMD, "[Get appid][%p] appid(%s)", vc_command, *appid);
- return 0;
+
+ return VC_ERROR_NONE;
}
int vc_cmd_set_command(vc_cmd_h vc_command, const char* command)
return VC_ERROR_PERMISSION_DENIED;
}
- if (NULL == vc_command) {
+ if (NULL == vc_command || NULL == command) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
return VC_ERROR_INVALID_PARAMETER;
}
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->command) {
+ if (cmd->command)
free(cmd->command);
- }
-
cmd->command = NULL;
-
- if (NULL != command) {
- cmd->command = strdup(command);
- }
+ cmd->command = strdup(command);
SLOG(LOG_DEBUG, TAG_VCCMD, "[Set command][%p] Command(%s)", vc_command, cmd->command);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_get_command(vc_cmd_h vc_command, char** command)
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->command) {
+ if (cmd->command)
*command = strdup(gettext(cmd->command));
- }
+ else
+ *command = NULL;
SLOG(LOG_DEBUG, TAG_VCCMD, "[Get command][%p] Command(%s)", vc_command, *command);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_set_unfixed_command(vc_cmd_h vc_command, const char* command)
return VC_ERROR_PERMISSION_DENIED;
}
- if (NULL == vc_command) {
+ if (NULL == vc_command || NULL == command) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
return VC_ERROR_INVALID_PARAMETER;
}
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->parameter) {
+ if (cmd->parameter)
free(cmd->parameter);
- }
-
cmd->parameter = NULL;
+ cmd->parameter = strdup(command);
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[Set unfixed command][%p] unfixed command(%s)", vc_command, cmd->parameter);
- if (NULL != command) {
- cmd->parameter = strdup(command);
- SLOG(LOG_DEBUG, TAG_VCCMD, "[Set unfixed command][%p] unfixed command(%s)", vc_command, cmd->parameter);
- }
-
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_get_unfixed_command(vc_cmd_h vc_command, char** command)
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->parameter) {
+ if (cmd->parameter)
*command = strdup(gettext(cmd->parameter));
- SLOG(LOG_DEBUG, TAG_VCCMD, "[Get unfixed command][%p] unfixed command(%s)", vc_command, *command);
- }
+ else
+ *command = NULL;
- return 0;
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[Get unfixed command][%p] unfixed command(%s)", vc_command, *command);
+
+ return VC_ERROR_NONE;
}
+//LCOV_EXCL_START
int vc_cmd_set_fixed_command(vc_cmd_h vc_command, const char* fixed)
{
if (0 != __vc_cmd_get_feature_enabled()) {
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->fixed) {
+ if (cmd->fixed)
free(cmd->fixed);
- cmd->fixed = NULL;
- }
-
+ cmd->fixed = NULL;
cmd->fixed = strdup(fixed);
SLOG(LOG_DEBUG, TAG_VCCMD, "[Set parameter][%p] fixed command(%s)", vc_command, cmd->fixed);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_get_fixed_command(vc_cmd_h vc_command, char** fixed)
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->fixed) {
+ if (cmd->fixed)
*fixed = strdup(gettext(cmd->fixed));
- SLOG(LOG_DEBUG, TAG_VCCMD, "[Get fixed command][%p] fixed command(%s)", vc_command, *fixed);
- }
+ else
+ *fixed = NULL;
- return 0;
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[Get fixed command][%p] fixed command(%s)", vc_command, *fixed);
+
+ return VC_ERROR_NONE;
}
+//LCOV_EXCL_STOP
int vc_cmd_set_invocation_name(vc_cmd_h vc_command, const char* invocation_name)
{
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->invocation_name) {
+ if (cmd->invocation_name)
free(cmd->invocation_name);
- cmd->invocation_name = NULL;
- }
-
+ cmd->invocation_name = NULL;
cmd->invocation_name = strdup(invocation_name);
SLOG(LOG_DEBUG, TAG_VCCMD, "[Set invocation name][%p] invocation_name(%s)", vc_command, cmd->invocation_name);
- return 0;
+ return VC_ERROR_NONE;
}
+//LCOV_EXCL_START
int vc_cmd_get_invocation_name(vc_cmd_h vc_command, char** invocation_name)
{
if (0 != __vc_cmd_get_feature_enabled()) {
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
- if (NULL != cmd->invocation_name) {
+ if (cmd->invocation_name)
*invocation_name = strdup(gettext(cmd->invocation_name));
- }
+ else
+ *invocation_name = NULL;
SLOG(LOG_DEBUG, TAG_VCCMD, "[Get invocation name][%p] invocation_name(%s)", vc_command, *invocation_name);
- return 0;
+ return VC_ERROR_NONE;
}
+//LCOV_EXCL_STOP
int vc_cmd_set_type(vc_cmd_h vc_command, int type)
{
return VC_ERROR_INVALID_PARAMETER;
}
+ if (VC_COMMAND_TYPE_NONE >= type || VC_COMMAND_TYPE_EXCLUSIVE < type) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid type(%d)", type);
+ return VC_ERROR_INVALID_PARAMETER;
+ }
+
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
SLOG(LOG_DEBUG, TAG_VCCMD, "[Set type][%p] type(%d)", vc_command, cmd->type);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_get_type(vc_cmd_h vc_command, int* type)
SLOG(LOG_DEBUG, TAG_VCCMD, "[Get type][%p] type(%d)", vc_command, *type);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_set_format(vc_cmd_h vc_command, int format)
return VC_ERROR_INVALID_PARAMETER;
}
+ if (VC_COMMAND_FORMAT_FIXED > format || VC_COMMAND_FORMAT_NONFIXED_AND_FIXED < format) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid format(%d)", format);
+ return VC_ERROR_INVALID_PARAMETER;
+ }
+
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
SLOG(LOG_DEBUG, TAG_VCCMD, "[Set format][%p] format(%d)", vc_command, format);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_get_format(vc_cmd_h vc_command, int* format)
SLOG(LOG_DEBUG, TAG_VCCMD, "[Get format][%p] format(%d)", vc_command, *format);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_set_pid(vc_cmd_h vc_command, int pid)
return VC_ERROR_INVALID_PARAMETER;
}
+ if (0 > pid) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid pid (%d)", pid);
+ return VC_ERROR_INVALID_PARAMETER;
+ }
+
vc_cmd_s* cmd = NULL;
cmd = (vc_cmd_s*)vc_command;
SLOG(LOG_DEBUG, TAG_VCCMD, "[Set pid][%p] pid(%d)", vc_command, cmd->pid);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_get_pid(vc_cmd_h vc_command, int* pid)
SLOG(LOG_DEBUG, TAG_VCCMD, "[Get pid][%p] pid(%d)", vc_command, *pid);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_set_domain(vc_cmd_h vc_command, int domain)
SLOG(LOG_DEBUG, TAG_VCCMD, "[Set domain] domain : %d", domain);
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_get_domain(vc_cmd_h vc_command, int* domain)
SLOG(LOG_DEBUG, TAG_VCCMD, "[Get domain] domain : %d", *domain);
- return 0;
+ return VC_ERROR_NONE;
}
+//LCOV_EXCL_START
/**
* @brief Sets key value of command.
*
*/
int vc_cmd_set_result_key(vc_cmd_h vc_command, int key, int modifier)
{
- SLOG(LOG_DEBUG, TAG_VCCMD, "===== Set result key");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Set result key");
if (NULL == vc_command) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
cmd->key = key;
cmd->modifier = modifier;
- SLOG(LOG_DEBUG, TAG_VCCMD, "=====");
- SLOG(LOG_DEBUG, TAG_VCCMD, " ");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@");
- return 0;
+ return VC_ERROR_NONE;
}
/**
*/
int vc_cmd_get_result_key(vc_cmd_h vc_command, int* key, int* modifier)
{
- SLOG(LOG_DEBUG, TAG_VCCMD, "===== Get result key");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Get result key");
if (NULL == vc_command || NULL == key || NULL == modifier) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
*key = cmd->key;
*modifier = cmd->modifier;
- SLOG(LOG_DEBUG, TAG_VCCMD, "=====");
- SLOG(LOG_DEBUG, TAG_VCCMD, " ");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@");
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_print_list(vc_cmd_list_h vc_cmd_list)
vc_cmd_list_s* list = NULL;
list = (vc_cmd_list_s*)vc_cmd_list;
- SLOG(LOG_DEBUG, TAG_VCCMD, "=== Command List ===");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@ Command List @");
SLOG(LOG_DEBUG, TAG_VCCMD, "[List][%p]", list);
- int count = g_slist_length(list->list);
-
- int i;
- vc_cmd_s *cmd = NULL;
-
- for (i = 0; i < count ; i++) {
- cmd = g_slist_nth_data(list->list, i);
-
- if (NULL != cmd) {
- SLOG(LOG_DEBUG, TAG_VCCMD, " [%d][%p] PID(%d) ID(%d) Type(%d) Format(%d) Command(%s) Param(%s) Appid(%s) Invocation(%s) Fixed(%s)",
- i, cmd, cmd->pid, cmd->index, cmd->type, cmd->format, cmd->command, cmd->parameter, cmd->appid, cmd->invocation_name, cmd->fixed);
+ int i = 0;
+ GSList *iter = NULL;
+ iter = g_slist_nth(list->list, 0);
+ while (NULL != iter) {
+ vc_cmd_s *cmd = NULL;
+ cmd = iter->data;
+ if (NULL == cmd) {
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] No command in list");
+ return VC_ERROR_OPERATION_FAILED;
}
+ SLOG(LOG_DEBUG, TAG_VCCMD, " [%d][%p] PID(%d) ID(%d) Type(%d) Format(%d) Command(%s) Param(%s) Appid(%s) Invocation(%s) Fixed(%s)",
+ i++, cmd, cmd->pid, cmd->index, cmd->type, cmd->format, cmd->command, cmd->parameter, cmd->appid, cmd->invocation_name, cmd->fixed);
+
+ iter = g_slist_next(iter);
}
- SLOG(LOG_DEBUG, TAG_VCCMD, "==================");
- SLOG(LOG_DEBUG, TAG_VCCMD, " ");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@");
- return 0;
+ return VC_ERROR_NONE;
}
int vc_cmd_get_nlu_json(vc_cmd_h vc_cmd, char** json)
return VC_ERROR_OPERATION_FAILED;
}
- return 0;
+ return VC_ERROR_NONE;
}
static void __vc_cmd_regex_deinit(int num_regex)
{
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Start Deinitialize regex ====");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Start Deinitialize regex @@@");
int i;
for (i = 0; num_regex > i; i++) {
regfree(®[i]);
}
- SLOG(LOG_DEBUG, TAG_VCCMD, "====");
- SLOG(LOG_DEBUG, TAG_VCCMD, "");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@");
}
static int __vc_cmd_regex_init()
{
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Initialize regular expression ====");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Initialize regular expression @@@");
int cflags = REG_EXTENDED | REG_ICASE;
int ret;
free(lang);
lang = NULL;
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== lang type > %d ====", lang_type);
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ lang type > %d @@@", lang_type);
re_syntax_options = RE_SYNTAX_POSIX_EXTENDED;
return VC_ERROR_OPERATION_FAILED;
}
- SLOG(LOG_DEBUG, TAG_VCCMD, "====");
- SLOG(LOG_DEBUG, TAG_VCCMD, "");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@");
return VC_ERROR_NONE;
}
static void __copy_struct_tm(struct tm *des, struct tm *src)
{
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Start to copy struct tm ====");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Start to copy struct tm @@@");
des->tm_sec = src->tm_sec;
des->tm_min = src->tm_min;
int hour = -1;
int min = -1;
- char *tempstr = NULL;
-
*exist = 0;
ret = regexec(®[3], str, 1, pmatch, 0);
if (0 == ret) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid string length");
return VC_ERROR_OPERATION_FAILED;
}
- tempstr = strndup(str + pmatch[1].rm_so, (size_t)len);
+ char *tempstr = strndup(str + pmatch[1].rm_so, (size_t)len);
if (NULL == tempstr) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Memory allocation is failed");
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid string length");
return VC_ERROR_OPERATION_FAILED;
}
- tempstr = strndup(str + pmatch[1].rm_so, (size_t)len);
+ char *tempstr = strndup(str + pmatch[1].rm_so, (size_t)len);
if (NULL == tempstr) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Memory allocation is failed");
int min = -1;
int sidx = -1;
int eidx = -1;
- char *tempstr = NULL;
*exist = 0;
ret = regexec(®[0], str, 5, pmatch, 0);
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid string length");
return VC_ERROR_OPERATION_FAILED;
}
- tempstr = strndup(str + pmatch[1].rm_so, (size_t)len);
+ char *tempstr = strndup(str + pmatch[1].rm_so, (size_t)len);
if (NULL == tempstr) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Memory allocation is failed");
}
if (0 > hour || 24 <= hour || (0 == flag && 12 < hour)) {
- SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incomming sentence is weird");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incoming sentence is weird");
+ free(tempstr);
+ tempstr = NULL;
return VC_ERROR_NONE;
}
if (0 > sidx || pmatch[0].rm_so < sidx) sidx = pmatch[0].rm_so;
if (0 > eidx || pmatch[0].rm_eo > eidx) eidx = pmatch[0].rm_eo;
} else if (0 < flag) {
- SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incomming sentence is weird");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incoming sentence is weird");
return VC_ERROR_NONE;
}
idx = 1;
len = pmatch[idx].rm_eo - pmatch[idx].rm_so;
if (0 < len) {
- tempstr = strndup(str + pmatch[idx].rm_so, (size_t)len);
+ char *tempstr = strndup(str + pmatch[idx].rm_so, (size_t)len);
if (NULL == tempstr) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Memory allocation is failed");
min = atoi(tempstr);
if (0 > min || 60 <= min) {
- SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incomming sentence is weird");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incoming sentence is weird");
+ free(tempstr);
+ tempstr = NULL;
return VC_ERROR_NONE;
}
}
if (!strcmp("en_US", lang)) {
- SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incomming sentence is weird");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incoming sentence is weird");
free(lang);
lang = NULL;
return VC_ERROR_NONE;
sidx = pmatch[0].rm_so;
eidx = pmatch[0].rm_eo;
} else {
- SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incomming sentence is weird");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incoming sentence is weird");
return VC_ERROR_NONE;
}
}
if (!strcmp("en_US", lang)) {
- SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incomming sentence is weird");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incoming sentence is weird");
free(lang);
lang = NULL;
return VC_ERROR_NONE;
td->tm_min = 0;
td->tm_sec = 0;
} else if (2 == g_time_flag) {
- SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incomming sentence is weird");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incoming sentence is weird");
return VC_ERROR_NONE;
}
if ((0 == (year + 1900) % 4 && 0 != (year + 1900) % 100) || 0 == (year + 1900) % 400) max_day[1] = 29;
if (max_day[mon] < day || 1 > day) {
- SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incomming sentence is weird");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] Incoming sentence is weird");
return VC_ERROR_NONE;
}
static int __vc_cmd_time_check(const char *str, struct tm *td)
{
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Check time value in string \"%s\"", str);
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Check time value in string \"%s\"", str);
vc_error_e ret;
int exist = 0;
if (1 == exist) {
g_time_flag = 1;
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Time value is exist");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Time value is exist");
return ret;
} else if (VC_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occured > (%d)", ret);
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occurred > (%d)", ret);
return ret;
}
if (1 == exist) {
g_time_flag = 2;
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Time value is exist");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Time value is exist");
return ret;
} else if (VC_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occured > (%d)", ret);
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occurred > (%d)", ret);
return ret;
}
if (1 == exist) {
g_time_flag = 3;
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Time value is exist");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Time value is exist");
return ret;
} else if (VC_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occured > (%d)", ret);
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occurred > (%d)", ret);
return ret;
}
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== There is no time value");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ There is no time value");
return VC_ERROR_NONE;
}
static int __vc_cmd_date_check(const char *str, struct tm *td)
{
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Check date value in string \"%s\"", str);
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Check date value in string \"%s\"", str);
vc_error_e ret;
int exist = 0;
if (1 == exist) {
g_date_flag = 1;
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Date value is exist");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Date value is exist");
return ret;
} else if (VC_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occured > (%d)", ret);
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occurred > (%d)", ret);
return ret;
}
if (1 == exist) {
g_date_flag = 1;
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Date value is exist");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Date value is exist");
return ret;
} else if (VC_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occured > (%d)", ret);
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occurred > (%d)", ret);
return ret;
}
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== There is no date value");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ There is no date value");
return VC_ERROR_NONE;
}
int vc_cmd_get_datetime(const char *text, time_t *result, char **remain)
{
- SLOG(LOG_DEBUG, TAG_VCCMD, "==== Get timestamp data");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@ Get timestamp data");
struct tm td;
const char *day_name[7] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
ret = __vc_cmd_time_check(text, &td);
if (VC_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occured in the check > (%d)", ret);
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occurred in the check > (%d)", ret);
return ret;
}
ret = __vc_cmd_date_check(text, &td);
if (VC_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occured in the check > (%d)", ret);
+ SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Error is occurred in the check > (%d)", ret);
return ret;
}
if (g_time_flag > 0 || g_date_flag > 0) {
*result = mktime(&td);
- SLOG(LOG_DEBUG, TAG_VCCMD, "Timestamp in the text = %d", *result);
+ SLOG(LOG_DEBUG, TAG_VCCMD, "Timestamp in the text = %ld", *result);
SLOG(LOG_DEBUG, TAG_VCCMD, "%d-%d-%d (%s), %d:%d:%d",
- td.tm_year + 1900, td.tm_mon + 1, td.tm_mday, day_name[td.tm_wday], td.tm_hour, td.tm_min, td.tm_sec, td.tm_yday);
+ td.tm_year + 1900, td.tm_mon + 1, td.tm_mday, day_name[td.tm_wday], td.tm_hour, td.tm_min, td.tm_sec);
*remain = (char *)calloc(sizeof(char), (strlen(text) + 1 - g_data_eidx + g_data_sidx));
SLOG(LOG_DEBUG, TAG_VCCMD, "[REGEX] There is no data in the text");
}
- SLOG(LOG_DEBUG, TAG_VCCMD, "====");
- SLOG(LOG_DEBUG, TAG_VCCMD, "");
+ SLOG(LOG_DEBUG, TAG_VCCMD, "@@@");
return VC_ERROR_NONE;
}
+//LCOV_EXCL_STOP