core-legacy/helpers.h
Tobias Reisinger 51ab1d7982 fix: save id as blob, not as string
add: some progress to new discovery
add: some tests
remove: migrations. restarting for now
2020-02-23 20:06:14 +01:00

44 lines
1 KiB
C++

#ifndef EMGAUWA_CORE_HELPERS_H
#define EMGAUWA_CORE_HELPERS_H
#include <json/value.h>
#include <models/period.h>
#include <models/period_list.h>
#include <sqlite3.h>
namespace helpers
{
int
bind_tcp_server(const char *addr, const char *port, int max_client_backlog);
int
get_server_port(int fd);
int
send_udp_broadcast(const char *addr, uint16_t port, void *message, size_t length);
period_list*
parse_periods(Json::Value periods_json);
typedef struct sql_filter_builder
{
sql_filter_builder(const char *col_name, const void *value, intptr_t bind_func, int bind_func_param, const char *logic);
const char *col_name;
const void *value;
intptr_t bind_func;
int bind_func_param;
const char *logic;
} sql_filter_builder;
sqlite3_stmt*
create_sql_filtered_query(const char *sql, sql_filter_builder **filters);
int
open_tcp_connection(char* host, char* port);
int
migrate_sql();
}
#endif //EMGAUWA_CORE_HELPERS_H