This repository has been archived by the owner on Feb 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create db.h and db schema update logic (#38)
* Create db.h and update c source files so they can find it. * Update db_migrate logic so it can handle schema upgrades.
- Loading branch information
1 parent
93a9e93
commit 6687f72
Showing
4 changed files
with
133 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* file: db.h | ||
* | ||
* Headerfile for sqlite interface | ||
*/ | ||
|
||
#ifndef _DB_HEADER | ||
#define _DB_HEADER | ||
|
||
#include <sqlite3.h> | ||
#include <stdbool.h> | ||
|
||
/* | ||
* db.c | ||
*/ | ||
bool db_open ( void ); | ||
bool db_close ( void ); | ||
bool db_execute ( const char *sql, ... ); | ||
sqlite3_stmt *db_prepare (const char *sql, ...); | ||
int db_step (sqlite3_stmt *stmt); | ||
int db_finalize (sqlite3_stmt *stmt); | ||
void db_migrate ( void ); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
/* main header file */ | ||
#include "mud.h" | ||
#include "db.h" | ||
|
||
void save_player(D_MOBILE *dMob) | ||
{ | ||
|