Improve LogMessageCallbackPtr documentation.

This commit is contained in:
levlam 2021-05-20 18:30:46 +03:00
parent 3f9b3046a6
commit 65c3c89ad6
4 changed files with 10 additions and 7 deletions

View File

@ -1,3 +1,3 @@
./src.ps1 | Select-String -NotMatch "CxCli.h" | Select-String -NotMatch "dotnet" | ForEach-Object { ./src.ps1 | Select-String -NotMatch "CxCli.h" | Select-String -NotMatch "DotNet" | ForEach-Object {
clang-format -verbose -style=file -i $_ clang-format -verbose -style=file -i $_
} }

View File

@ -241,8 +241,9 @@ class ClientManager final {
/** /**
* A type of callback function that will be called when a message is added to the internal TDLib log. * A type of callback function that will be called when a message is added to the internal TDLib log.
* *
* \param verbosity_level Log verbosity level with which the message was added. If 0, then TDLib will crash * \param verbosity_level Log verbosity level with which the message was added (-1 - 1024).
* as soon as the callback returns. * If 0, then TDLib will crash as soon as the callback returns.
* None of the TDLib methods can be called from the callback.
* \param message Null-terminated string with the message added to the log. * \param message Null-terminated string with the message added to the log.
*/ */
using LogMessageCallbackPtr = void (*)(int verbosity_level, const char *message); using LogMessageCallbackPtr = void (*)(int verbosity_level, const char *message);

View File

@ -25,8 +25,9 @@ using namespace CxCli;
/// <summary> /// <summary>
/// A type of callback function that will be called when a message is added to the internal TDLib log. /// A type of callback function that will be called when a message is added to the internal TDLib log.
/// </summary> /// </summary>
/// <param name="verbosityLevel">Log verbosity level with which the message was added. If 0, /// <param name="verbosityLevel">Log verbosity level with which the message was added (-1 - 1024).
/// then TDLib will crash as soon as the callback returns.</param> /// If 0, then TDLib will crash as soon as the callback returns.
/// None of the TDLib methods can be called from the callback.</param>
/// <param name="message">Null-terminated string with the message added to the log.</param> /// <param name="message">Null-terminated string with the message added to the log.</param>
public delegate void LogMessageCallback(int verbosityLevel, String^ message); public delegate void LogMessageCallback(int verbosityLevel, String^ message);
#endif #endif

View File

@ -159,7 +159,9 @@ TDJSON_EXPORT const char *td_execute(const char *request);
/** /**
* A type of callback function that will be called when a message is added to the internal TDLib log. * A type of callback function that will be called when a message is added to the internal TDLib log.
* *
* \param verbosity_level Log verbosity level with which the message was added. * \param verbosity_level 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.
* \param message Null-terminated string with the logged message. * \param message Null-terminated string with the logged message.
*/ */
typedef void (*td_log_message_callback_ptr)(int verbosity_level, const char *message); typedef void (*td_log_message_callback_ptr)(int verbosity_level, const char *message);
@ -167,7 +169,6 @@ typedef void (*td_log_message_callback_ptr)(int verbosity_level, const char *mes
/** /**
* Sets the callback that will be called when a message is added to the internal TDLib log. * 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. * None of the TDLib methods can be called from the callback.
* If message verbosity level is 0, then TDLib will crash as soon as callback returns.
* By default the callback is not set. * By default the callback is not set.
* *
* \param[in] max_verbosity_level Maximum verbosity level of messages for which the callback will be called. * \param[in] max_verbosity_level Maximum verbosity level of messages for which the callback will be called.