"priv_id = %d, internal_group_id = %d where rowid = %d",
rowid, rowid, rowid);
- return notification_db_exec(db, query);
+ return notification_db_exec(db, query, NULL);
}
EXPORT_API int notification_noti_insert(notification_h noti)
snprintf(query, sizeof(query), "%s where priv_id in (%s)", query_base, query_where);
NOTIFICATION_ERR("check : %s", query);
- ret = notification_db_exec(db, query);
+ ret = notification_db_exec(db, query, NULL);
} else {
free(*list_deleted_rowid);
*list_deleted_rowid = NULL;
snprintf(query_base, sizeof(query_base), "delete from noti_list ");
snprintf(query, sizeof(query), "%s %s", query_base, query_where);
- ret = notification_db_exec(db, query);
+ ret = notification_db_exec(db, query, NULL);
if (num_deleted != NULL) {
*num_deleted = sqlite3_changes(db);
snprintf(query, sizeof(query), "%s where priv_id in (%s)", query_base, query_where);
NOTIFICATION_ERR("check : %s", query);
- ret = notification_db_exec(db, query);
+ ret = notification_db_exec(db, query, NULL);
} else {
free(*list_deleted_rowid);
*list_deleted_rowid = NULL;
snprintf(query, sizeof(query), "delete from noti_list %s", query_where);
/* execute DB */
- ret = notification_db_exec(db, query);
+ ret = notification_db_exec(db, query, NULL);
}
err:
pkgname, internal_group_id);
/* execute DB */
- ret = notification_db_exec(db, query);
+ ret = notification_db_exec(db, query, NULL);
/* Close DB */
notification_db_close(&db);
priv_id);
/* execute DB */
- ret = notification_db_exec(db, query);
+ ret = notification_db_exec(db, query, NULL);
+
+ /* Close DB */
+ if (db) {
+ notification_db_close(&db);
+ }
+
+ return ret;
+}
+
+EXPORT_API int notification_noti_delete_by_priv_id_get_changes(const char *pkgname, int priv_id, int *num_changes)
+{
+ sqlite3 *db = NULL;
+ char query[NOTIFICATION_QUERY_MAX] = { 0, };
+ int ret;
+
+ /* Check pkgname is valid */
+ if (pkgname == NULL) {
+ return NOTIFICATION_ERROR_INVALID_DATA;
+ }
+
+ /* Open DB */
+ db = notification_db_open(DBPATH);
+ if (!db) {
+ return NOTIFICATION_ERROR_FROM_DB;
+ }
+
+ /* Make query */
+ snprintf(query, sizeof(query), "delete from noti_list "
+ "where caller_pkgname = '%s' and priv_id = %d", pkgname,
+ priv_id);
+
+ /* execute DB */
+ ret = notification_db_exec(db, query, num_changes);
+
+ if (num_changes != NULL) {
+ NOTIFICATION_DBG("deleted num:%d", *num_changes);
+ }
/* Close DB */
if (db) {