summaryrefslogtreecommitdiffstats
path: root/ts3db.h
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-12-06 05:37:41 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2011-12-06 05:37:41 +0100
commit915ebf954d4247c4caeaea5a7e40fce30f19e1bc (patch)
tree6341d69bfbd0159537e94e0fe19480270b913ce8 /ts3db.h
downloadts3db_postgres-915ebf954d4247c4caeaea5a7e40fce30f19e1bc.tar.gz
ts3db_postgres-915ebf954d4247c4caeaea5a7e40fce30f19e1bc.tar.xz
ts3db_postgres-915ebf954d4247c4caeaea5a7e40fce30f19e1bc.zip
initial import, some test
Diffstat (limited to 'ts3db.h')
-rw-r--r--ts3db.h48
1 files changed, 48 insertions, 0 deletions
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