2018-12-31 20:04:05 +01:00
|
|
|
//
|
2021-01-01 13:57:46 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
|
2018-12-31 20:04:05 +01:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#include "td/telegram/td_json_client.h"
|
|
|
|
#include "td/telegram/td_log.h"
|
|
|
|
|
2021-09-18 23:47:05 +02:00
|
|
|
#include "td/actor/ConcurrentScheduler.h"
|
|
|
|
|
2018-12-31 20:04:05 +01:00
|
|
|
#include <emscripten.h>
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
2020-11-14 23:13:11 +01:00
|
|
|
EMSCRIPTEN_KEEPALIVE double td_emscripten_create_client_id() {
|
|
|
|
return td_create_client_id();
|
2018-12-31 20:04:05 +01:00
|
|
|
}
|
2020-10-08 01:52:34 +02:00
|
|
|
|
|
|
|
EMSCRIPTEN_KEEPALIVE void td_emscripten_send(double client_id, const char *query) {
|
|
|
|
td_send(static_cast<int>(client_id), query);
|
2018-12-31 20:04:05 +01:00
|
|
|
}
|
2020-10-08 01:52:34 +02:00
|
|
|
|
|
|
|
EMSCRIPTEN_KEEPALIVE const char *td_emscripten_receive() {
|
|
|
|
return td_receive(0);
|
2018-12-31 20:04:05 +01:00
|
|
|
}
|
2020-10-08 01:52:34 +02:00
|
|
|
|
|
|
|
EMSCRIPTEN_KEEPALIVE const char *td_emscripten_execute(const char *query) {
|
|
|
|
return td_execute(query);
|
2018-12-31 20:04:05 +01:00
|
|
|
}
|
2020-10-08 01:52:34 +02:00
|
|
|
|
2020-10-08 01:12:51 +02:00
|
|
|
EMSCRIPTEN_KEEPALIVE double td_emscripten_get_timeout() {
|
2018-09-18 15:43:16 +02:00
|
|
|
return td::ConcurrentScheduler::emscripten_get_main_timeout();
|
|
|
|
}
|
2018-12-31 20:04:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
emscripten_exit_with_live_runtime();
|
|
|
|
return 0;
|
|
|
|
}
|