2018-12-31 20:04:05 +01:00
|
|
|
//
|
2024-01-01 01:07:21 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
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)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "td/telegram/td_tdc_api.h"
|
|
|
|
|
|
|
|
struct TdVectorInt *TdCreateObjectVectorInt(int size, int *data);
|
|
|
|
struct TdVectorLong *TdCreateObjectVectorLong(int size, long long *data);
|
|
|
|
struct TdVectorObject *TdCreateObjectVectorObject(int size, struct TdObject **data);
|
|
|
|
struct TdBytes TdCreateObjectBytes(unsigned char *data, int len);
|
|
|
|
|
|
|
|
struct TdRequest {
|
2021-09-26 21:17:02 +02:00
|
|
|
long long request_id;
|
2021-11-10 01:45:13 +01:00
|
|
|
struct TdFunction *function;
|
2018-12-31 20:04:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct TdResponse {
|
2021-09-26 21:17:02 +02:00
|
|
|
long long request_id;
|
|
|
|
int client_id;
|
2021-11-10 01:45:13 +01:00
|
|
|
struct TdObject *object;
|
2018-12-31 20:04:05 +01:00
|
|
|
};
|
|
|
|
|
2021-09-26 21:17:02 +02:00
|
|
|
int TdCClientCreateId();
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2021-09-26 21:17:02 +02:00
|
|
|
void TdCClientSend(int client_id, struct TdRequest request);
|
|
|
|
|
2021-11-10 01:45:13 +01:00
|
|
|
struct TdResponse TdCClientReceive(double timeout);
|
2021-09-26 21:17:02 +02:00
|
|
|
|
2021-11-10 01:45:13 +01:00
|
|
|
struct TdObject *TdCClientExecute(struct TdFunction *function);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|