mc_retvm_if(handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
mc_retvm_if(server_name == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "server_name is NULL");
+ mc_debug("server name [%s]", server_name);
+
sql_str = sqlite3_mprintf("SELECT COUNT(*) FROM SQLITE_MASTER WHERE type='table' and name='%q'", server_name);
mc_retvm_if(!MC_STRING_VALID(sql_str), MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "SQL string is null");
*exist = TRUE;
} else {
mc_debug("No server info [%s]", server_name);
+ mc_db_foreach_server_list(handle, NULL, NULL);
+
*exist = FALSE;
}
mc_retvm_if(handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
mc_retvm_if(client_name == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "server_name is NULL");
+ mc_debug("client name [%s]", client_name);
+
sql_str = sqlite3_mprintf("SELECT COUNT(*) FROM '%q' WHERE client_name='%q'", MC_DB_TABLE_CLIENT_LIST, client_name);
mc_retvm_if(!MC_STRING_VALID(sql_str), MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "SQL string is null");
*exist = TRUE;
} else {
mc_debug("No client info [%s]", client_name);
+ mc_db_foreach_client_list(handle, NULL, NULL);
+
*exist = FALSE;
}
sqlite3 *db_handle = (sqlite3 *)handle;
char *sql_str = NULL;
sqlite3_stmt *stmt = NULL;
+ int idx = 0;
mc_retvm_if(db_handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
return MEDIA_CONTROLLER_ERROR_NONE;
}
+ mc_info("[ * Activated Server List - Start * ]");
+
while (SQLITE_ROW == ret) {
char *server_name = NULL;
server_name = strdup((char *)sqlite3_column_text(stmt, 0));
- if (callback(server_name, user_data) == false) {
- MC_SAFE_FREE(server_name);
- break;
+
+ idx++;
+ mc_info("[%d] %s", idx, server_name);
+
+ if (callback != NULL) {
+ if (callback(server_name, user_data) == false) {
+ MC_SAFE_FREE(server_name);
+ break;
+ }
}
+
MC_SAFE_FREE(server_name);
ret = sqlite3_step(stmt);
}
+ mc_info("[ * Activated Server List - End * ]");
+
SQLITE3_FINALIZE(stmt);
SQLITE3_SAFE_FREE(sql_str);
sqlite3 *db_handle = (sqlite3 *)handle;
char *sql_str = NULL;
sqlite3_stmt *stmt = NULL;
+ int idx = 0;
mc_retvm_if(db_handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
return MEDIA_CONTROLLER_ERROR_NONE;
}
+ mc_info("[ * Activated Client List - Start * ]");
+
while (SQLITE_ROW == ret) {
char *client_name = NULL;
client_name = strdup((char *)sqlite3_column_text(stmt, 0));
- if (callback(client_name, user_data) == false) {
- MC_SAFE_FREE(client_name);
- break;
+
+ idx++;
+ mc_info("[%d] %s", idx, client_name);
+
+ if (callback != NULL) {
+ if (callback(client_name, user_data) == false) {
+ MC_SAFE_FREE(client_name);
+ break;
+ }
}
MC_SAFE_FREE(client_name);
ret = sqlite3_step(stmt);
}
+ mc_info("[ * Activated Client List - End * ]");
+
SQLITE3_FINALIZE(stmt);
SQLITE3_SAFE_FREE(sql_str);