mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
add deleteGame()
This commit is contained in:
parent
a6784464ff
commit
c33c50ee6b
2 changed files with 14 additions and 0 deletions
|
@ -216,6 +216,19 @@ loadGame( XWStreamCtxt* stream, sqlite3* pDb, sqlite3_int64 rowid )
|
|||
return XP_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
deleteGame( sqlite3* pDb, sqlite3_int64 rowid )
|
||||
{
|
||||
char query[256];
|
||||
snprintf( query, sizeof(query), "DELETE FROM games WHERE rowid = %lld", rowid );
|
||||
sqlite3_stmt* ppStmt;
|
||||
int result = sqlite3_prepare_v2( pDb, query, -1, &ppStmt, NULL );
|
||||
XP_ASSERT( SQLITE_OK == result );
|
||||
result = sqlite3_step( ppStmt );
|
||||
XP_ASSERT( SQLITE_DONE == result );
|
||||
sqlite3_finalize( ppStmt );
|
||||
}
|
||||
|
||||
void
|
||||
store( sqlite3* pDb, const gchar* key, const gchar* value )
|
||||
{
|
||||
|
|
|
@ -47,6 +47,7 @@ void summarize( CommonGlobals* cGlobals );
|
|||
GSList* listGames( GtkAppGlobals* apg );
|
||||
XP_Bool getGameInfo( GtkAppGlobals* apg, sqlite3_int64 rowid, GameInfo* gib );
|
||||
XP_Bool loadGame( XWStreamCtxt* stream, sqlite3* pDb, sqlite3_int64 rowid );
|
||||
void deleteGame( sqlite3* pDb, sqlite3_int64 rowid );
|
||||
|
||||
#define KEY_RDEVID "RDEVID"
|
||||
|
||||
|
|
Loading…
Reference in a new issue