123456789101112131415161718192021222324252627282930313233343536373839 |
- /*
- * database.h
- *
- * Created on: Dec 4, 2015
- * Author: Philipp Hinz
- */
- #ifndef DATABASE_H_
- #define DATABASE_H_
- #include <string>
- #include <stdexcept>
- #include <cstdio>
- #include <stdlib.h>
- #include <inttypes.h>
- #include <cstdarg>
- #include "sqlite/sqlite3.h"
- using namespace std;
- // Config Keys
- typedef enum {
- brewcounter = 1,
- } config_key_t;
- int sqlOpen();
- void sqlClose();
- int sqlSetup();
- int sqlExecute(string query);
- char *inttochar(uint8_t *guid);
- uint8_t *chartoint(const unsigned char *guid);
- uint8_t *int64to8bit(sqlite_int64 guid);
- sqlite_int64 int8to64bit(uint8_t *guid);
- void sqltest();
- std::string string_sprintf(const char* format, ...);
- uint64_t sqlGetConf(config_key_t id);
- int sqlSetConf(config_key_t id, uint64_t value);
- #endif /* DATABASE_H_ */
|