core-legacy/helpers.h
Tobias Reisinger ac61c26d56 add: basic relay structure
add: improved sql calls
2019-07-20 23:33:17 +02:00

35 lines
788 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 s_sql_filter_builder
{
const char *col_name;
const void *value;
const intptr_t bind_func;
const char *logic;
} sql_filter_builder;
sqlite3_stmt*
create_sql_filtered_query(const char *sql, sql_filter_builder **filters);
}
#endif //EMGAUWA_CORE_HELPERS_H