74 lines
1.2 KiB
C
74 lines
1.2 KiB
C
|
|
#ifndef _sqlite
|
||
|
|
|
||
|
|
#define _sqlite
|
||
|
|
|
||
|
|
|
||
|
|
// Macros
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#include "stdlib.h"
|
||
|
|
|
||
|
|
extern char * __ClassNames[];
|
||
|
|
|
||
|
|
|
||
|
|
// Includes
|
||
|
|
|
||
|
|
#include "console.h"
|
||
|
|
|
||
|
|
#include <text.h>
|
||
|
|
|
||
|
|
#include <array.h>
|
||
|
|
|
||
|
|
#include <string.h>
|
||
|
|
|
||
|
|
#include <stdio.h>
|
||
|
|
|
||
|
|
#include <sqlite3.h>
|
||
|
|
|
||
|
|
#include <stdlib.h>
|
||
|
|
|
||
|
|
#include <classConfiguration.h>
|
||
|
|
|
||
|
|
|
||
|
|
typedef struct sqlite{
|
||
|
|
|
||
|
|
unsigned short __classIndex;
|
||
|
|
|
||
|
|
sqlite3 * db;
|
||
|
|
|
||
|
|
sqlite3_stmt * res;
|
||
|
|
|
||
|
|
char * value;
|
||
|
|
|
||
|
|
char * selectedModel;
|
||
|
|
|
||
|
|
|
||
|
|
} sqlite;
|
||
|
|
|
||
|
|
void sqlite_constructor( sqlite * this, char * filePath );
|
||
|
|
|
||
|
|
void sqlite_connect( sqlite * this, char * filePath );
|
||
|
|
|
||
|
|
void sqlite_free( sqlite * this );
|
||
|
|
|
||
|
|
void sqlite_selectModel( sqlite * this, char * className );
|
||
|
|
|
||
|
|
void sqlite_createTable( sqlite * this );
|
||
|
|
|
||
|
|
void sqlite_addRows( sqlite * this, array * insertArray );
|
||
|
|
|
||
|
|
void sqlite_updateRow( sqlite * this, sqlite3_stmt * result, int propertyCount, char * * propertyNames, int * propertyOffsets, int * datatypeIndices, char * pointer );
|
||
|
|
|
||
|
|
void sqlite_update( sqlite * this, void * row );
|
||
|
|
|
||
|
|
void sqlite_addRow( sqlite * this, void * row );
|
||
|
|
|
||
|
|
struct array * sqlite_fetchRows( sqlite * this, char * sql );
|
||
|
|
|
||
|
|
sqlite sqlite_new( char * filePath );
|
||
|
|
|
||
|
|
sqlite * sqlite_newPointer( char * filePath );
|
||
|
|
|
||
|
|
#endif
|