#define SQLITE3_SAFE_FREE(sql_string) {if(sql_string) { sqlite3_free(sql_string); sql_string = NULL;}}
#define SQLITE3_FINALIZE(x) {if(x != NULL) {sqlite3_finalize(x);}}
-int mc_db_connect(void **db_handle, bool needWrite);
+int mc_db_connect(void **db_handle, bool need_write);
int mc_db_disconnect(void *db_handle);
int mc_db_create_tables(void *handle);
int mc_db_create_server_table(void *handle, const char *server_name);
return MEDIA_CONTROLLER_ERROR_NONE;
}
-int mc_db_connect(void **handle, bool needWrite)
+int mc_db_connect(void **handle, bool need_write)
{
int ret = MEDIA_CONTROLLER_ERROR_NONE;
sqlite3 *db_handle = NULL;
mc_retvm_if(handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
/*Connect DB*/
- if(needWrite) {
+ if(need_write) {
ret = db_util_open_with_options(tzplatform_mkpath(TZ_USER_DB, MC_DB_NAME), &db_handle, SQLITE_OPEN_READWRITE, NULL);
} else {
ret = db_util_open_with_options(tzplatform_mkpath(TZ_USER_DB, MC_DB_NAME), &db_handle, SQLITE_OPEN_READONLY, NULL);
return result_psswd_rtn;
}
-int mc_db_util_connect(void **handle, uid_t uid, bool needWrite)
+int mc_db_util_connect(void **handle, uid_t uid, bool need_write)
{
int ret = MEDIA_CONTROLLER_ERROR_NONE;
sqlite3 *db_handle = NULL;
mc_retvm_if(handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
/*Connect DB*/
- if(needWrite) {
+ if(need_write) {
ret = db_util_open_with_options(__mc_get_db_name(uid), &db_handle, SQLITE_OPEN_READWRITE, NULL);
} else {
ret = db_util_open_with_options(__mc_get_db_name(uid), &db_handle, SQLITE_OPEN_READONLY, NULL);
#define SQLITE3_SAFE_FREE(sql_string) {if(sql_string) { sqlite3_free(sql_string); sql_string = NULL;}}
#define SQLITE3_FINALIZE(x) {if(x != NULL) {sqlite3_finalize(x);}}
-int mc_db_util_connect(void **handle, uid_t uid, bool needWrite);
+int mc_db_util_connect(void **handle, uid_t uid, bool need_write);
int mc_db_util_update_db(void *handle, const char *sql_str);
int mc_db_util_disconnect(void *handle);