Update content of files

This commit is contained in:
GitHub Action 2021-12-29 17:52:48 +00:00
parent 89e90fbd90
commit c4a28c9652
4 changed files with 653 additions and 471 deletions

View file

@ -83,7 +83,6 @@ $(function() {
<li><a href="#usage">Examples and documentation</a></li>
<li><a href="#dependencies">Dependencies</a></li>
<li><a href="#building">Building</a></li>
<li><a href="#installing-dependencies">Installing dependencies</a></li>
<li><a href="#using-cxx">Using in CMake C++ projects</a></li>
<li><a href="#using-java">Using in Java projects</a></li>
<li><a href="#using-dotnet">Using in .NET projects</a></li>
@ -93,7 +92,7 @@ $(function() {
<p><a class="anchor" id="features"></a> </p><h2>Features</h2>
<p><code>TDLib</code> has many advantages. Notably <code>TDLib</code> is:</p>
<ul>
<li><b>Cross-platform</b>: <code>TDLib</code> can be used on Android, iOS, Windows, macOS, Linux, FreeBSD, OpenBSD, NetBSD, Windows Phone, WebAssembly, watchOS, tvOS, Tizen, Cygwin. It should also work on other *nix systems with or without minimal effort.</li>
<li><b>Cross-platform</b>: <code>TDLib</code> can be used on Android, iOS, Windows, macOS, Linux, FreeBSD, OpenBSD, NetBSD, illumos, Windows Phone, WebAssembly, watchOS, tvOS, Tizen, Cygwin. It should also work on other *nix systems with or without minimal effort.</li>
<li><b>Multilanguage</b>: <code>TDLib</code> can be easily used with any programming language that is able to execute C functions. Additionally it already has native Java (using <code>JNI</code>) bindings and .NET (using <code>C++/CLI</code> and <code>C++/CX</code>) bindings.</li>
<li><b>Easy to use</b>: <code>TDLib</code> takes care of all network implementation details, encryption and local data storage.</li>
<li><b>High-performance</b>: in the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>, each <code>TDLib</code> instance handles more than 24000 active bots simultaneously.</li>
@ -121,38 +120,16 @@ $(function() {
</ul>
<p><a class="anchor" id="building"></a> </p><h2>Building</h2>
<p>The simplest way to build <code>TDLib</code> is to use our <a href="https://tdlib.github.io/td/build.html">TDLib build instructions generator</a>. You need only to choose your programming language and target operating system to receive complete build instructions.</p>
<p>In general, you need to install all <code>TDLib</code> <a href="#dependencies">dependencies</a> as described in <a href="#installing-dependencies">Installing dependencies</a>. Then enter directory containing <code>TDLib</code> sources and compile them using CMake:</p>
<p>In general, you need to install all <code>TDLib</code> <a href="#dependencies">dependencies</a>, enter directory containing <code>TDLib</code> sources and compile them using CMake:</p>
<div class="fragment"><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -DCMAKE_BUILD_TYPE=Release ..</div><div class="line">cmake --build .</div></div><!-- fragment --><p>To build <code>TDLib</code> on low memory devices you can run <a href="https://github.com/tdlib/td/blob/master/SplitSource.php">SplitSource.php</a> script before compiling main <code>TDLib</code> source code and compile only needed targets: </p><div class="fragment"><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -DCMAKE_BUILD_TYPE=Release ..</div><div class="line">cmake --build . --target prepare_cross_compiling</div><div class="line">cd ..</div><div class="line">php SplitSource.php</div><div class="line">cd build</div><div class="line">cmake --build . --target tdjson</div><div class="line">cmake --build . --target tdjson_static</div><div class="line">cd ..</div><div class="line">php SplitSource.php --undo</div></div><!-- fragment --><p> In our tests clang 6.0 with libc++ required less than 500 MB of RAM per file and GCC 4.9/6.3 used less than 1 GB of RAM per file.</p>
<p><a class="anchor" id="installing-dependencies"></a> </p><h3>Installing dependencies</h3>
<p><a class="anchor" id="macos"></a> </p><h4>macOS</h4>
<ul>
<li>Install the latest Xcode command line tools, for example, via <code>xcode-select --install</code>.</li>
<li>Install other <a href="#dependencies">dependencies</a>, for example, using <a href="https://brew.sh">Homebrew</a>: <div class="fragment"><div class="line">brew install gperf cmake openssl</div></div><!-- fragment --></li>
<li>Build <code>TDLib</code> with CMake as explained in <a href="#building">building</a>. You will likely need to manually specify path to the installed OpenSSL to CMake, e.g., <div class="fragment"><div class="line">cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ ..</div></div><!-- fragment --></li>
</ul>
<p><a class="anchor" id="windows"></a> </p><h4>Windows</h4>
<ul>
<li>Download and install Microsoft Visual Studio 2015 or later.</li>
<li>Download and install <a href="https://sourceforge.net/projects/gnuwin32/files/gperf/3.0.1/">gperf</a>. Add the path to gperf.exe to the PATH environment variable.</li>
<li>Install <a href="https://github.com/Microsoft/vcpkg#quick-start">vcpkg</a>.</li>
<li>Run the following commands to install <code>TDLib</code> dependencies using vcpkg: <div class="fragment"><div class="line">cd &lt;path to vcpkg&gt;</div><div class="line">.\vcpkg.exe install openssl:x64-windows openssl:x86-windows zlib:x64-windows zlib:x86-windows</div></div><!-- fragment --></li>
<li>Download and install <a href="https://cmake.org/download/">CMake</a>; choose "Add CMake to the system PATH" option while installing.</li>
<li>Build <code>TDLib</code> with CMake as explained in <a href="#building">building</a>, but instead of <code>cmake -DCMAKE_BUILD_TYPE=Release ..</code> use <div class="fragment"><div class="line">cmake -DCMAKE_TOOLCHAIN_FILE=&lt;path to vcpkg&gt;/scripts/buildsystems/vcpkg.cmake ..</div></div><!-- fragment --></li>
</ul>
<p>To build 32-bit/64-bit <code>TDLib</code> using MSVC, you will need to additionally specify parameter <code>-A Win32</code>/<code>-A x64</code> to CMake. To build <code>TDLib</code> in Release mode using MSVC, you will need to additionally specify parameter <code>--config Release</code> to the <code>cmake --build .</code> command.</p>
<p><a class="anchor" id="linux"></a> </p><h4>Linux</h4>
<ul>
<li>Install all <a href="#dependencies">dependencies</a> using your package manager.</li>
</ul>
<p><a class="anchor" id="using-cxx"></a> </p><h2>Using in CMake C++ projects</h2>
<p>For C++ projects that use CMake, the best approach is to build <code>TDLib</code> as part of your project or to install it system-wide.</p>
<p>There are several libraries that you could use in your CMake project:</p>
<ul>
<li>Td::TdJson, Td::TdJsonStatic — dynamic and static version of a JSON interface. This has a simple C interface, so it can be easily used with any programming language that is able to execute C functions. See <a href="https://core.telegram.org/tdlib/docs/td__json__client_8h.html">td_json_client</a> and <a href="https://core.telegram.org/tdlib/docs/td__log_8h.html">td_log</a> documentation for more information.</li>
<li>Td::TdStatic — static library with C++ interface for general usage. See <a href="https://core.telegram.org/tdlib/docs/classtd_1_1_client.html">Client</a> and <a href="https://core.telegram.org/tdlib/docs/classtd_1_1_log.html">Log</a> documentation for more information.</li>
<li>Td::TdCoreStatic — static library with low-level C++ interface intended mostly for internal usage. See <a href="https://core.telegram.org/tdlib/docs/classtd_1_1_client_actor.html">ClientActor</a> and <a href="https://core.telegram.org/tdlib/docs/classtd_1_1_log.html">Log</a> documentation for more information.</li>
<li>Td::TdJson, Td::TdJsonStatic — dynamic and static version of a JSON interface. This has a simple C interface, so it can be easily used with any programming language that is able to execute C functions. See <a href="https://core.telegram.org/tdlib/docs/td__json__client_8h.html">td_json_client</a> documentation for more information.</li>
<li>Td::TdStatic — static library with C++ interface for general usage. See <a href="https://core.telegram.org/tdlib/docs/classtd_1_1_client_manager.html">ClientManager</a> and <a href="https://core.telegram.org/tdlib/docs/classtd_1_1_client.html">Client</a> documentation for more information.</li>
</ul>
<p>For example, part of your CMakeLists.txt may look like this: </p><div class="fragment"><div class="line">add_subdirectory(td)</div><div class="line">target_link_libraries(YourTarget PRIVATE Td::TdStatic)</div></div><!-- fragment --><p>Or you could install <code>TDLib</code> and then reference it in your CMakeLists.txt like this: </p><div class="fragment"><div class="line">find_package(Td 1.7.0 REQUIRED)</div><div class="line">target_link_libraries(YourTarget PRIVATE Td::TdStatic)</div></div><!-- fragment --><p> See <a href="https://github.com/tdlib/td/tree/master/example/cpp/CMakeLists.txt">example/cpp/CMakeLists.txt</a>.</p>
<p>For example, part of your CMakeLists.txt may look like this: </p><div class="fragment"><div class="line">add_subdirectory(td)</div><div class="line">target_link_libraries(YourTarget PRIVATE Td::TdStatic)</div></div><!-- fragment --><p>Or you could install <code>TDLib</code> and then reference it in your CMakeLists.txt like this: </p><div class="fragment"><div class="line">find_package(Td 1.8.0 REQUIRED)</div><div class="line">target_link_libraries(YourTarget PRIVATE Td::TdStatic)</div></div><!-- fragment --><p> See <a href="https://github.com/tdlib/td/tree/master/example/cpp/CMakeLists.txt">example/cpp/CMakeLists.txt</a>.</p>
<p><a class="anchor" id="using-java"></a> </p><h2>Using in Java projects</h2>
<p><code>TDLib</code> provides native Java interface through JNI. To enable it, specify option <code>-DTD_ENABLE_JNI=ON</code> to CMake.</p>
<p>See <a href="https://github.com/tdlib/td/tree/master/example/java">example/java</a> for example of using <code>TDLib</code> from Java and detailed build and usage instructions.</p>
@ -160,7 +137,7 @@ $(function() {
<p><code>TDLib</code> provides native .NET interface through <code>C++/CLI</code> and <code>C++/CX</code>. To enable it, specify option <code>-DTD_ENABLE_DOTNET=ON</code> to CMake. .NET Core supports <code>C++/CLI</code> only since version 3.1 and only on Windows, so if older .NET Core is used or portability is needed, then <code>TDLib</code> JSON interface should be used through P/Invoke instead.</p>
<p>See <a href="https://github.com/tdlib/td/tree/master/example/csharp">example/csharp</a> for example of using <code>TDLib</code> from C# and detailed build and usage instructions. See <a href="https://github.com/tdlib/td/tree/master/example/uwp">example/uwp</a> for example of using <code>TDLib</code> from C# UWP application and detailed build and usage instructions for Visual Studio Extension "TDLib for Universal Windows Platform".</p>
<p>When <code>TDLib</code> is built with <code>TD_ENABLE_DOTNET</code> option enabled, <code>C++</code> documentation is removed from some files. You need to checkout these files to return <code>C++</code> documentation back: </p><div class="fragment"><div class="line">git checkout td/telegram/Client.h td/telegram/Log.h td/tl/TlObject.h</div></div><!-- fragment --><p><a class="anchor" id="using-json"></a> </p><h2>Using from other programming languages</h2>
<p><code>TDLib</code> provides efficient native C++, Java, and .NET interfaces. But for most use cases we suggest to use the JSON interface, which can be easily used with any programming language that is able to execute C functions. See <a href="https://core.telegram.org/tdlib/docs/td__json__client_8h.html">td_json_client</a> and <a href="https://core.telegram.org/tdlib/docs/td__log_8h.html">td_log</a> documentation for detailed JSON interface description, the <a href="https://github.com/tdlib/td/blob/master/td/generate/scheme/td_api.tl">td_api.tl</a> scheme or the automatically generated <a href="https://core.telegram.org/tdlib/docs/td__api_8h.html">HTML documentation</a> for a list of all available <code>TDLib</code> <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_function.html">methods</a> and <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_object.html">classes</a>.</p>
<p><code>TDLib</code> provides efficient native C++, Java, and .NET interfaces. But for most use cases we suggest to use the JSON interface, which can be easily used with any programming language that is able to execute C functions. See <a href="https://core.telegram.org/tdlib/docs/td__json__client_8h.html">td_json_client</a> documentation for detailed JSON interface description, the <a href="https://github.com/tdlib/td/blob/master/td/generate/scheme/td_api.tl">td_api.tl</a> scheme or the automatically generated <a href="https://core.telegram.org/tdlib/docs/td__api_8h.html">HTML documentation</a> for a list of all available <code>TDLib</code> <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_function.html">methods</a> and <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_object.html">classes</a>.</p>
<p><code>TDLib</code> JSON interface adheres to semantic versioning and versions with the same major version number are binary and backward compatible, but the underlying <code>TDLib</code> API can be different for different minor and even patch versions. If you need to support different <code>TDLib</code> versions, then you can use a value of the <code>version</code> option to find exact <code>TDLib</code> version to use appropriate API methods.</p>
<p>See <a href="https://github.com/tdlib/td/tree/master/example/python/tdjson_example.py">example/python/tdjson_example.py</a> for an example of such usage.</p>
<p><a class="anchor" id="license"></a> </p><h2>License</h2>

File diff suppressed because it is too large Load diff

View file

@ -77,6 +77,7 @@ $(function() {
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">td_json_client.h File Reference</div> </div>
@ -84,13 +85,33 @@ $(function() {
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<div class="textblock"><p>C interface for interaction with TDLib via JSON-serialized objects. Can be used to easily integrate TDLib with any programming language which supports calling C functions and is able to work with JSON.</p>
<p>The JSON serialization of TDLib API objects is straightforward: all API objects are represented as JSON objects with the same keys as the API object field names. The object type name is stored in the special field "@type" which is optional in places where type is uniquely determined by the context. Fields of Bool type are stored as Boolean, fields of int32, int53, and double types are stored as Number, fields of int64 and string types are stored as String, fields of bytes type are base64 encoded and then stored as String, fields of array type are stored as Array. The main TDLib interface is asynchronous. To match requests with a corresponding response a field "@extra" can be added to the request object. The corresponding response will have an "@extra" field with exactly the same value.</p>
<p>The JSON serialization of TDLib API objects is straightforward: all API objects are represented as JSON objects with the same keys as the API object field names. The object type name is stored in the special field "@type" which is optional in places where type is uniquely determined by the context. Fields of Bool type are stored as Boolean, fields of int32, int53, and double types are stored as Number, fields of int64 and string types are stored as String, fields of bytes type are base64 encoded and then stored as String, fields of array type are stored as Array.</p>
<p>The main TDLib interface is asynchronous. To match requests with a corresponding response, the field "@extra" can be added to the request object. The corresponding response will have an "@extra" field with exactly the same value. Each returned object will have an "@client_id" field, containing the identifier of the client for which a response or an update was received.</p>
<p>A TDLib client instance can be created through td_create_client_id. Requests can be sent using td_send and the received client identifier. New updates and responses to requests can be received through td_receive from any thread after the first request has been sent to the client instance. This function must not be called simultaneously from two different threads. Also note that all updates and responses to requests must be applied in the order they were received for consistency. Some TDLib requests can be executed synchronously from any thread using td_execute. TDLib client instances are destroyed automatically after they are closed. All TDLib client instances must be closed before application termination to ensure data consistency.</p>
<p>General pattern of usage: </p><div class="fragment"><div class="line"><span class="keywordtype">int</span> client_id = <a class="code" href="td__json__client_8h.html#a7feda953a66eee36bc207eb71a55c490">td_create_client_id</a>();</div><div class="line"><span class="comment">// share the client_id with other threads, which will be able to send requests via td_send</span></div><div class="line"></div><div class="line"><span class="keyword">const</span> <span class="keywordtype">double</span> WAIT_TIMEOUT = 10.0; <span class="comment">// seconds</span></div><div class="line"><span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div><div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span> *result = <a class="code" href="td__json__client_8h.html#a62715bea8e41a554d1bac763c187b662">td_receive</a>(WAIT_TIMEOUT);</div><div class="line"> <span class="keywordflow">if</span> (result) {</div><div class="line"> <span class="comment">// parse the result as a JSON object and process it as an incoming update or the answer to a previously sent request</span></div><div class="line"> }</div><div class="line">}</div></div><!-- fragment --><p>Alternatively, you can use old TDLib JSON interface, which will be removed in TDLib 2.0.0.</p>
<p>Objects and functions serialization to JSON is the same for both JSON interfaces.</p>
<p>The main TDLib interface is asynchronous. To match requests with a corresponding response a field "@extra" can be added to the request object. The corresponding response will have an "@extra" field with exactly the same value.</p>
<p>A TDLib client instance can be created through td_json_client_create. Requests then can be sent using td_json_client_send from any thread. New updates and request responses can be received through td_json_client_receive from any thread. This function must not be called simultaneously from two different threads. Also note that all updates and request responses must be applied in the order they were received to ensure consistency. Given this information, it's advisable to call this function from a dedicated thread. Some service TDLib requests can be executed synchronously from any thread by using td_json_client_execute. The TDLib client instance can be destroyed via td_json_client_destroy.</p>
<p>General pattern of usage: </p><div class="fragment"><div class="line"><span class="keywordtype">void</span> *client = <a class="code" href="td__json__client_8h.html#a45cd6979ada11b7690d9dcb1ddc841a0">td_json_client_create</a>();</div><div class="line"><span class="comment">// somehow share the client with other threads, which will be able to send requests via td_json_client_send</span></div><div class="line"></div><div class="line"><span class="keyword">const</span> <span class="keywordtype">double</span> WAIT_TIMEOUT = 10.0; <span class="comment">// seconds</span></div><div class="line"><span class="keywordtype">int</span> is_closed = 0; <span class="comment">// should be set to 1, when updateAuthorizationState with authorizationStateClosed is received</span></div><div class="line"><span class="keywordflow">while</span> (!is_closed) {</div><div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span> *result = <a class="code" href="td__json__client_8h.html#a9e0cb36bfa2bc2249905aebd7d07a4ac">td_json_client_receive</a>(client, WAIT_TIMEOUT);</div><div class="line"> <span class="keywordflow">if</span> (result) {</div><div class="line"> <span class="comment">// parse the result as JSON object and process it as an incoming update or an answer to a previously sent request</span></div><div class="line"> }</div><div class="line">}</div><div class="line"><a class="code" href="td__json__client_8h.html#a75c765a44f3bdf6a724d90c2e7f75ecf">td_json_client_destroy</a>(client);</div></div><!-- fragment --> </div>
<p><a href="td__json__client_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a967769864d76b43cf3ad779b801971d5"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#a967769864d76b43cf3ad779b801971d5">td_log_message_callback_ptr</a>) (int verbosity_level, const char *message)</td></tr>
<tr class="separator:a967769864d76b43cf3ad779b801971d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a7feda953a66eee36bc207eb71a55c490"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#a7feda953a66eee36bc207eb71a55c490">td_create_client_id</a> ()</td></tr>
<tr class="separator:a7feda953a66eee36bc207eb71a55c490"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8a6b2061559c80887af75381abdbddf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#aa8a6b2061559c80887af75381abdbddf">td_send</a> (int client_id, const char *request)</td></tr>
<tr class="separator:aa8a6b2061559c80887af75381abdbddf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a62715bea8e41a554d1bac763c187b662"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#a62715bea8e41a554d1bac763c187b662">td_receive</a> (double timeout)</td></tr>
<tr class="separator:a62715bea8e41a554d1bac763c187b662"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff3d28f8896cf0b74f7825e3198f5b3e"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#aff3d28f8896cf0b74f7825e3198f5b3e">td_execute</a> (const char *request)</td></tr>
<tr class="separator:aff3d28f8896cf0b74f7825e3198f5b3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c7d765c53703b3c082bbd6f77eb2de6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#a1c7d765c53703b3c082bbd6f77eb2de6">td_set_log_message_callback</a> (int max_verbosity_level, <a class="el" href="td__json__client_8h.html#a967769864d76b43cf3ad779b801971d5">td_log_message_callback_ptr</a> callback)</td></tr>
<tr class="separator:a1c7d765c53703b3c082bbd6f77eb2de6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a45cd6979ada11b7690d9dcb1ddc841a0"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#a45cd6979ada11b7690d9dcb1ddc841a0">td_json_client_create</a> ()</td></tr>
<tr class="separator:a45cd6979ada11b7690d9dcb1ddc841a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fea1f986bf950d19eee3032c24cce83"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#a1fea1f986bf950d19eee3032c24cce83">td_json_client_send</a> (void *client, const char *request)</td></tr>
@ -101,16 +122,170 @@ Functions</h2></td></tr>
<tr class="separator:a6d6c76380793072d4a9ce3c71ba0f1cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75c765a44f3bdf6a724d90c2e7f75ecf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#a75c765a44f3bdf6a724d90c2e7f75ecf">td_json_client_destroy</a> (void *client)</td></tr>
<tr class="separator:a75c765a44f3bdf6a724d90c2e7f75ecf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7feda953a66eee36bc207eb71a55c490"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#a7feda953a66eee36bc207eb71a55c490">td_create_client_id</a> ()</td></tr>
<tr class="separator:a7feda953a66eee36bc207eb71a55c490"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8a6b2061559c80887af75381abdbddf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#aa8a6b2061559c80887af75381abdbddf">td_send</a> (int client_id, const char *request)</td></tr>
<tr class="separator:aa8a6b2061559c80887af75381abdbddf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a62715bea8e41a554d1bac763c187b662"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#a62715bea8e41a554d1bac763c187b662">td_receive</a> (double timeout)</td></tr>
<tr class="separator:a62715bea8e41a554d1bac763c187b662"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff3d28f8896cf0b74f7825e3198f5b3e"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__json__client_8h.html#aff3d28f8896cf0b74f7825e3198f5b3e">td_execute</a> (const char *request)</td></tr>
<tr class="separator:aff3d28f8896cf0b74f7825e3198f5b3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a967769864d76b43cf3ad779b801971d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a967769864d76b43cf3ad779b801971d5">&#9670;&nbsp;</a></span>td_log_message_callback_ptr</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* td_log_message_callback_ptr) (int verbosity_level, const char *message)</td>
</tr>
</table>
</div><div class="memdoc">
<p>A type of callback function that will be called when a message is added to the internal TDLib log.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">verbosity_level</td><td>Log verbosity level with which the message was added (-1 - 1024). If 0, then TDLib will crash as soon as the callback returns. None of the TDLib methods can be called from the callback. </td></tr>
<tr><td class="paramname">message</td><td>Null-terminated string with the logged message. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a7feda953a66eee36bc207eb71a55c490"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7feda953a66eee36bc207eb71a55c490">&#9670;&nbsp;</a></span>td_create_client_id()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int td_create_client_id </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns an opaque identifier of a new TDLib instance. The TDLib instance will not send updates until the first request is sent to it. </p><dl class="section return"><dt>Returns</dt><dd>Opaque identifier of a new TDLib instance. </dd></dl>
</div>
</div>
<a id="aa8a6b2061559c80887af75381abdbddf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8a6b2061559c80887af75381abdbddf">&#9670;&nbsp;</a></span>td_send()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void td_send </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>client_id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>request</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sends request to the TDLib client. May be called from any thread. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">client_id</td><td>TDLib client identifier. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">request</td><td>JSON-serialized null-terminated request to TDLib. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a62715bea8e41a554d1bac763c187b662"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a62715bea8e41a554d1bac763c187b662">&#9670;&nbsp;</a></span>td_receive()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* td_receive </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>timeout</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>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. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The maximum number of seconds allowed for this function to wait for new data. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>JSON-serialized null-terminated incoming update or request response. May be NULL if the timeout expires. </dd></dl>
</div>
</div>
<a id="aff3d28f8896cf0b74f7825e3198f5b3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff3d28f8896cf0b74f7825e3198f5b3e">&#9670;&nbsp;</a></span>td_execute()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* td_execute </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>request</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>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. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">request</td><td>JSON-serialized null-terminated request to TDLib. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>JSON-serialized null-terminated request response. </dd></dl>
</div>
</div>
<a id="a1c7d765c53703b3c082bbd6f77eb2de6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c7d765c53703b3c082bbd6f77eb2de6">&#9670;&nbsp;</a></span>td_set_log_message_callback()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void td_set_log_message_callback </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>max_verbosity_level</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="td__json__client_8h.html#a967769864d76b43cf3ad779b801971d5">td_log_message_callback_ptr</a>&#160;</td>
<td class="paramname"><em>callback</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>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.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">max_verbosity_level</td><td>The maximum verbosity level of messages for which the callback will be called. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>Callback that will be called when a message is added to the internal TDLib log. Pass nullptr to remove the callback. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a45cd6979ada11b7690d9dcb1ddc841a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a45cd6979ada11b7690d9dcb1ddc841a0">&#9670;&nbsp;</a></span>td_json_client_create()</h2>
@ -258,109 +433,6 @@ Functions</h2></td></tr>
</dd>
</dl>
</div>
</div>
<a id="a7feda953a66eee36bc207eb71a55c490"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7feda953a66eee36bc207eb71a55c490">&#9670;&nbsp;</a></span>td_create_client_id()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int td_create_client_id </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns an opaque identifier of a new TDLib instance. The TDLib instance will not send updates until the first request is sent to it. </p><dl class="section return"><dt>Returns</dt><dd>Opaque identifier of a new TDLib instance. </dd></dl>
</div>
</div>
<a id="aa8a6b2061559c80887af75381abdbddf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8a6b2061559c80887af75381abdbddf">&#9670;&nbsp;</a></span>td_send()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void td_send </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>client_id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>request</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sends request to the TDLib client. May be called from any thread. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">client_id</td><td>TDLib client identifier. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">request</td><td>JSON-serialized null-terminated request to TDLib. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a62715bea8e41a554d1bac763c187b662"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a62715bea8e41a554d1bac763c187b662">&#9670;&nbsp;</a></span>td_receive()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* td_receive </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>timeout</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>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. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The maximum number of seconds allowed for this function to wait for new data. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>JSON-serialized null-terminated incoming update or request response. May be NULL if the timeout expires. </dd></dl>
</div>
</div>
<a id="aff3d28f8896cf0b74f7825e3198f5b3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff3d28f8896cf0b74f7825e3198f5b3e">&#9670;&nbsp;</a></span>td_execute()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* td_execute </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>request</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>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. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">request</td><td>JSON-serialized null-terminated request to TDLib. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>JSON-serialized null-terminated request response. </dd></dl>
</div>
</div>
</div><!-- contents -->

View file

@ -1,295 +0,0 @@
<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TDLib: td/telegram/td_log.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript" src="tg_doxygen.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="tg_doxygen.css" rel="stylesheet" type="text/css"/>
<link href="tg_tabs.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<div class="tg_navbar clearfix">
<div class="tg_navbar_inner">
<div class="tg_container clearfix">
<ul class="tg_nav tg_navbar_nav tg_navbar_right tg_hidden_xs">
<li class="tg_navbar_twitter"><a href="https://twitter.com/telegram" target="_blank"><i class="tg_icon_twitter"></i><span> Twitter</span></a></li></ul>
<ul class="tg_nav tg_navbar_nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="tg_hidden_xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="tg_hidden_xs"><a href="//telegram.org/apps">Apps</a></li>
<li><a href="/api">API</a></li>
<li><a href="/mtproto">Protocol</a></li>
<li><a href="/schema">Schema</a></li>
<li class="active"><a href="/tdlib">TDLib</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_05b22fcca9bb47fde58f0d0dd2892ac6.html">td</a></li><li class="navelem"><a class="el" href="dir_a49186d4b022e03550aa19f8980c74c2.html">telegram</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">td_log.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<div class="textblock"><p>C interface for managing the internal logging of TDLib. By default TDLib writes logs to stderr or an OS specific log and uses a verbosity level of 5. These functions are deprecated since TDLib 1.4.0 in favor of the setLogVerbosityLevel, setLogStream and other synchronous requests for managing the intrenal TDLib logging. </p>
</div>
<p><a href="td__log_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a1cf3f18645e0f8d3eadb1b93e6cff2a8"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__log_8h.html#a1cf3f18645e0f8d3eadb1b93e6cff2a8">td_log_fatal_error_callback_ptr</a>) (const char *error_message)</td></tr>
<tr class="separator:a1cf3f18645e0f8d3eadb1b93e6cff2a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aef509cfb91b276f88f4ed68f5b0561bf"><td class="memItemLeft" align="right" valign="top">TDJSON_DEPRECATED_EXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__log_8h.html#aef509cfb91b276f88f4ed68f5b0561bf">td_set_log_file_path</a> (const char *file_path)</td></tr>
<tr class="separator:aef509cfb91b276f88f4ed68f5b0561bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21a9629b39afa1a7aafc6a5504621b6a"><td class="memItemLeft" align="right" valign="top">TDJSON_DEPRECATED_EXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__log_8h.html#a21a9629b39afa1a7aafc6a5504621b6a">td_set_log_max_file_size</a> (long long max_file_size)</td></tr>
<tr class="separator:a21a9629b39afa1a7aafc6a5504621b6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebf8cd00741501f033c47e2e0ed8a15b"><td class="memItemLeft" align="right" valign="top">TDJSON_DEPRECATED_EXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__log_8h.html#aebf8cd00741501f033c47e2e0ed8a15b">td_set_log_verbosity_level</a> (int new_verbosity_level)</td></tr>
<tr class="separator:aebf8cd00741501f033c47e2e0ed8a15b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addebe91c4525817a6d2b448634c19d71"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="td__log_8h.html#addebe91c4525817a6d2b448634c19d71">td_set_log_fatal_error_callback</a> (<a class="el" href="td__log_8h.html#a1cf3f18645e0f8d3eadb1b93e6cff2a8">td_log_fatal_error_callback_ptr</a> callback)</td></tr>
<tr class="separator:addebe91c4525817a6d2b448634c19d71"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a1cf3f18645e0f8d3eadb1b93e6cff2a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1cf3f18645e0f8d3eadb1b93e6cff2a8">&#9670;&nbsp;</a></span>td_log_fatal_error_callback_ptr</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* td_log_fatal_error_callback_ptr) (const char *error_message)</td>
</tr>
</table>
</div><div class="memdoc">
<p>A type of callback function that will be called when a fatal error happens.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">error_message</td><td>Null-terminated string with a description of a happened fatal error. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="aef509cfb91b276f88f4ed68f5b0561bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef509cfb91b276f88f4ed68f5b0561bf">&#9670;&nbsp;</a></span>td_set_log_file_path()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TDJSON_DEPRECATED_EXPORT int td_set_log_file_path </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>file_path</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>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.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">file_path</td><td>Null-terminated path to a file where the internal TDLib log will be written. Use an empty path to switch back to the default logging behaviour. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True 1 on success, or 0 otherwise, i.e. if the file can't be opened for writing. </dd></dl>
</div>
</div>
<a id="a21a9629b39afa1a7aafc6a5504621b6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a21a9629b39afa1a7aafc6a5504621b6a">&#9670;&nbsp;</a></span>td_set_log_max_file_size()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TDJSON_DEPRECATED_EXPORT void td_set_log_max_file_size </td>
<td>(</td>
<td class="paramtype">long long&#160;</td>
<td class="paramname"><em>max_file_size</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>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.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">max_file_size</td><td>The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated. Should be positive. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aebf8cd00741501f033c47e2e0ed8a15b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aebf8cd00741501f033c47e2e0ed8a15b">&#9670;&nbsp;</a></span>td_set_log_verbosity_level()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TDJSON_DEPRECATED_EXPORT void td_set_log_verbosity_level </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>new_verbosity_level</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the verbosity level of the internal logging of TDLib. By default the TDLib uses a log verbosity level of 5.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">new_verbosity_level</td><td>New value of logging verbosity level. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1024 can be used to enable even more logging. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="addebe91c4525817a6d2b448634c19d71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#addebe91c4525817a6d2b448634c19d71">&#9670;&nbsp;</a></span>td_set_log_fatal_error_callback()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void td_set_log_fatal_error_callback </td>
<td>(</td>
<td class="paramtype"><a class="el" href="td__log_8h.html#a1cf3f18645e0f8d3eadb1b93e6cff2a8">td_log_fatal_error_callback_ptr</a>&#160;</td>
<td class="paramname"><em>callback</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>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.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>Callback that will be called when a fatal error happens. Pass NULL to remove the callback. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<hr class="footer"/>
<div class="tg_footer_wrap">
<div class="tg_footer_columns_wrap clearfix tg_footer_desktop">
<div class="tg_footer_column tg_footer_column_telegram">
<h5>Telegram</h5>
<div class="tg_footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="tg_footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/blog">Blog</a></li>
<li><a href="//telegram.org/press">Press</a></li>
</ul>
</div>
<div class="tg_footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/dl/android">Android</a></li>
<li><a href="//telegram.org/dl/wp">Windows Phone</a></li>
</ul>
</div>
<div class="tg_footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="tg_footer_column tg_footer_column_platform">
<h5><a href="/">Platform</a></h5>
<ul>
<li><a href="/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="tg_footer_columns_wrap clearfix tg_footer_mobile">
<div class="tg_footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="tg_footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="tg_footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="tg_footer_column">
<h5><a href="/">Platform</a></h5>
</div>
<div class="tg_footer_column">
<h5><a href="//twitter.com/telegram" target="_blank">Twitter</a></h5>
</div>
</div>
</div>
<script type="text/javascript">tgApplyFixes();</script>
</body>
</html>