Initial import
This commit is contained in:
commit
660133c812
28 changed files with 3983 additions and 0 deletions
35
CallCapture/UserDataStore.h
Normal file
35
CallCapture/UserDataStore.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Copyright 2015 by Artem Prilutskiy
|
||||
|
||||
#ifndef USERDATASTORE_H
|
||||
#define USERDATASTORE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
#include <mysql/mysql.h>
|
||||
|
||||
#define PREPARED_STATEMENT_COUNT 2
|
||||
|
||||
#define LONG_CALLSIGN_LENGTH 8
|
||||
#define SLOW_DATA_TEXT_LENGTH 20
|
||||
|
||||
class UserDataStore
|
||||
{
|
||||
public:
|
||||
|
||||
UserDataStore(const char* file);
|
||||
~UserDataStore();
|
||||
|
||||
uint32_t getPrivateIDForCall(const char* call);
|
||||
bool getCredentialsForID(uint32_t number, char* call, char* text);
|
||||
|
||||
protected:
|
||||
|
||||
MYSQL* connection;
|
||||
MYSQL_STMT* statements[PREPARED_STATEMENT_COUNT];
|
||||
|
||||
MYSQL_BIND* bind(int count, va_list* arguments);
|
||||
bool execute(int index, int count1, int count2, ...);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue