NativeLibrary class

Constructors

NativeLibrary(DynamicLibrary dynamicLibrary)
The symbols are looked up in dynamicLibrary.
NativeLibrary.fromLookup(Pointer<T> lookup<T extends NativeType>(String symbolName))
The symbols are looked up with lookup.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
td_create_client_id() int
Returns an opaque identifier of a new TDLib instance. The TDLib instance will not send updates until the first request is sent to it. \return Opaque identifier of a new TDLib instance.
td_execute(Pointer<Int8> request) Pointer<Int32>
Synchronously executes a TDLib request. A request can be executed synchronously, only if it is documented with "Can be called synchronously". The returned pointer can be used until the next call to td_receive or td_execute, after which it will be deallocated by TDLib. \paramin request JSON-serialized null-terminated request to TDLib. \return JSON-serialized null-terminated request response.
td_json_client_create() Pointer<Int32>
Creates a new instance of TDLib. \return Pointer to the created instance of TDLib.
td_json_client_destroy(Pointer<Void> client) int
Destroys the TDLib client instance. After this is called the client instance must not be used anymore. \paramin client The client.
td_json_client_execute(Pointer<Void> client, Pointer<Int8> request) Pointer<Int32>
Synchronously executes TDLib request. May be called from any thread. Only a few requests can be executed synchronously. Returned pointer will be deallocated by TDLib during next call to td_json_client_receive or td_json_client_execute in the same thread, so it can't be used after that. \paramin client The client. Currently ignored for all requests, so NULL can be passed. \paramin request JSON-serialized null-terminated request to TDLib. \return JSON-serialized null-terminated request response.
td_json_client_receive(Pointer<Void> client, double timeout) Pointer<Int32>
Receives incoming updates and request responses from the TDLib client. May be called from any thread, but must not be called simultaneously from two different threads. Returned pointer will be deallocated by TDLib during next call to td_json_client_receive or td_json_client_execute in the same thread, so it can't be used after that. \paramin client The client. \paramin timeout The maximum number of seconds allowed for this function to wait for new data. \return JSON-serialized null-terminated incoming update or request response. May be NULL if the timeout expires.
td_json_client_send(Pointer<Void> client, Pointer<Int8> request) int
Sends request to the TDLib client. May be called from any thread. \paramin client The client. \paramin request JSON-serialized null-terminated request to TDLib.
td_receive(double timeout) Pointer<Int32>
Receives incoming updates and request responses. Must not be called simultaneously from two different threads. The returned pointer can be used until the next call to td_receive or td_execute, after which it will be deallocated by TDLib. \paramin timeout The maximum number of seconds allowed for this function to wait for new data. \return JSON-serialized null-terminated incoming update or request response. May be NULL if the timeout expires.
td_send(int client_id, Pointer<Int8> request) int
Sends request to the TDLib client. May be called from any thread. \paramin client_id TDLib client identifier. \paramin request JSON-serialized null-terminated request to TDLib.
td_set_log_fatal_error_callback(Pointer<NativeFunction<td_log_fatal_error_callback_ptr>> callback) int
Sets the callback that will be called when a fatal error happens. None of the TDLib methods can be called from the callback. The TDLib will crash as soon as callback returns. By default the callback is not set.
td_set_log_file_path(Pointer<Int8> file_path) int
Sets the path to the file where the internal TDLib log will be written. By default TDLib writes logs to stderr or an OS specific log. Use this method to write the log to a file instead.
td_set_log_max_file_size(int max_file_size) int
Sets the maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated. Unused if log is not written to a file. Defaults to 10 MB.
td_set_log_message_callback(int max_verbosity_level, Pointer<NativeFunction<td_log_message_callback_ptr>> callback) int
Sets the callback that will be called when a message is added to the internal TDLib log. None of the TDLib methods can be called from the callback. By default the callback is not set.
td_set_log_verbosity_level(int new_verbosity_level) int
Sets the verbosity level of the internal logging of TDLib. By default the TDLib uses a log verbosity level of 5.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited