Started creating database code

This commit is contained in:
Polonkai Gergely 2012-03-21 14:59:39 +00:00
parent b29f7c9063
commit 98967395c4
4 changed files with 31 additions and 1 deletions

7
sql/players.sql Normal file
View File

@ -0,0 +1,7 @@
CREATE TABLE players (
id integer primary key,
login varchar(50) not null unique,
password varchar(50),
email varchar(150) not null unique
);

View File

@ -1,5 +1,5 @@
bin_PROGRAMS = wmud
AM_CFLAGS = $(MEMCACHED_CFLAGS) $(GLIB_CFLAGS) $(GIO_CFLAGS) $(GTHREAD_CFLAGS) $(SQLITE3_CFLAGS)
wmud_SOURCES = main.c networking.c interpreter.c
wmud_SOURCES = main.c networking.c interpreter.c db.c
wmud_LDADD = $(MEMCACHED_LIBS) $(GLIB_LIBS) $(GIO_LIBS) $(GTHREAD_LIBS) $(SQLITE3_LIBS)

12
src/db.c Normal file
View File

@ -0,0 +1,12 @@
#include <sqlite3.h>
#include "db.h"
sqlite3 *dbh = NULL;
gboolean
wmud_db_init(void)
{
sqlite3_open(
}

11
src/db.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef __WMUD_DB_H__
#define __WMUD_DB_H__
#include <glib.h>
gboolean wmud_db_init(Gerror ** error);
gboolean wmud_load_players(GError **err);
gboolean wmud_save_player(wmudPlayer *player, GError **err);
#endif /* __WMUD__DB_H__ */