core-legacy/helpers.h
Tobias Reisinger 907b52160a add: migration from main exe
add: sql files embedded in exe
2019-09-22 02:34:22 +02:00

43 lines
975 B
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, const char* message);
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, const char *logic);
const char *col_name;
const void *value;
intptr_t bind_func;
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