add deleteGame()

This commit is contained in:
Eric House 2013-01-16 21:11:35 -08:00
parent a6784464ff
commit c33c50ee6b
2 changed files with 14 additions and 0 deletions

View file

@ -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 )
{

View file

@ -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"