From 915ebf954d4247c4caeaea5a7e40fce30f19e1bc Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 6 Dec 2011 05:37:41 +0100 Subject: initial import, some test --- ts3db.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 ts3db.h (limited to 'ts3db.h') diff --git a/ts3db.h b/ts3db.h new file mode 100644 index 0000000..2c7c4cf --- /dev/null +++ b/ts3db.h @@ -0,0 +1,48 @@ +#ifndef TS3DB_H +#define TS3DB_H + +typedef enum { + CRITICAL = 0, + ERROR = 1, + WARNING = 2, + DEBUG = 3, + INFO = 4, + DEVELOP = 5 +} loglevel; + +// common/log/log.cpp:73: +// void Log::logging(const std::string&, LogLevel, const std::string&, uint64) +// Assertion `lvl >= LogLevel_CRITICAL && lvl <= LogLevel_DEVEL' failed. +typedef int(*log_callback) (const char *msg, loglevel level); + +typedef void(*field_callback) (unsigned int res_nr, char* fieldname, void *context); +typedef void(*value_callback) (unsigned int index, char *value, void* context); +typedef void(*row_callback) (void* context); + +char *ts3dbplugin_version(); + +char *ts3dbplugin_name(); + +int ts3dbplugin_disconnect(); + +void ts3dbplugin_shutdown(); + +int ts3dbplugin_init(log_callback log, char *parameter); + +int ts3dbplugin_connect(unsigned int *connection_nr); + +char *ts3dbplugin_getlasterror(unsigned int connection_nr); + +unsigned int ts3dbplugin_tableexists(unsigned int connection_nr, const char* table_name); + +unsigned long long ts3dbplugin_getmodifiedrowcount(unsigned int connection_nr); + +unsigned long long ts3dbplugin_getlastinsertid(unsigned int connection_nr); + +unsigned int ts3dbplugin_open(unsigned int connection_nr, const char* query, + field_callback new_field, value_callback new_value, + row_callback new_row, void *context); + +unsigned int ts3dbplugin_exec(unsigned int connection_nr, const char* query); + +#endif -- cgit v1.2.3