diff options
author | Martin Willers <M.Willers@gmx.net> | 2021-05-31 07:45:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 14:45:48 +0900 |
commit | 3bb7eb24092ff771ccfd1119f8c1088f3f78f981 (patch) | |
tree | 58ef9ed71736b72f929eaa508c088184654e4701 /include/dlt/dlt_user.h.in | |
parent | d40ecef57050a48ca2abf9c307793d183972658e (diff) | |
download | DLT-daemon-3bb7eb24092ff771ccfd1119f8c1088f3f78f981.tar.gz |
Add missing string functions (#309)
Signed-off-by: Martin Willers <M.Willers@gmx.net>
Diffstat (limited to 'include/dlt/dlt_user.h.in')
-rw-r--r-- | include/dlt/dlt_user.h.in | 64 |
1 files changed, 60 insertions, 4 deletions
diff --git a/include/dlt/dlt_user.h.in b/include/dlt/dlt_user.h.in index e4a1f06..960b9f0 100644 --- a/include/dlt/dlt_user.h.in +++ b/include/dlt/dlt_user.h.in @@ -496,7 +496,7 @@ DltReturnValue dlt_user_log_write_sized_string(DltContextData *log, const char * /** * Write a constant null terminated ASCII string into a DLT log message. - * In non verbose mode DLT parameter will not be send at all. + * In non verbose mode DLT parameter will not be sent at all. * dlt_user_log_write_start has to be called before adding any attributes to the log message. * Finish sending log message by calling dlt_user_log_write_finish. * @param log pointer to an object containing information about logging context data @@ -507,11 +507,11 @@ DltReturnValue dlt_user_log_write_constant_string(DltContextData *log, const cha /** * Write a constant, potentially non-null-terminated ASCII string into a DLT log message. - * In non verbose mode DLT parameter will not be send at all. + * In non verbose mode DLT parameter will not be sent at all. * dlt_user_log_write_start has to be called before adding any attributes to the log message. * Finish sending log message by calling dlt_user_log_write_finish. * @param log pointer to an object containing information about logging context data - * @param text pointer to the parameter written into log message containing null termination. + * @param text pointer to the parameter written into log message * @param length length in bytes of @a text (without any termination character) * @return Value from DltReturnValue enum */ @@ -539,6 +539,29 @@ DltReturnValue dlt_user_log_write_utf8_string(DltContextData *log, const char *t DltReturnValue dlt_user_log_write_sized_utf8_string(DltContextData *log, const char *text, uint16_t length); /** + * Write a constant null terminated UTF8 string into a DLT log message. + * In non verbose mode DLT parameter will not be sent at all. + * dlt_user_log_write_start has to be called before adding any attributes to the log message. + * Finish sending log message by calling dlt_user_log_write_finish. + * @param log pointer to an object containing information about logging context data + * @param text pointer to the parameter written into log message containing null termination. + * @return Value from DltReturnValue enum + */ +DltReturnValue dlt_user_log_write_constant_utf8_string(DltContextData *log, const char *text); + +/** + * Write a constant, potentially non-null-terminated UTF8 string into a DLT log message. + * In non verbose mode DLT parameter will not be sent at all. + * dlt_user_log_write_start has to be called before adding any attributes to the log message. + * Finish sending log message by calling dlt_user_log_write_finish. + * @param log pointer to an object containing information about logging context data + * @param text pointer to the parameter written into log message + * @param length length in bytes of @a text (without any termination character) + * @return Value from DltReturnValue enum + */ +DltReturnValue dlt_user_log_write_sized_constant_utf8_string(DltContextData *log, const char *text, uint16_t length); + +/** * Write a null-terminated ASCII string with "name" attribute into a DLT log message. * dlt_user_log_write_start has to be called before adding any parameters to the log message. * Finish building a log message by calling dlt_user_log_write_finish. @@ -595,7 +618,7 @@ DltReturnValue dlt_user_log_write_constant_string_attr(DltContextData *log, cons * and no content to the message. * * @param log pointer to an object containing information about logging context data - * @param text pointer to the parameter written into log message containing null termination + * @param text pointer to the parameter written into log message * @param length length in bytes of @a text (without any termination character) * @param name the "name" attribute (or NULL) * @return value from DltReturnValue enum @@ -634,6 +657,39 @@ DltReturnValue dlt_user_log_write_utf8_string_attr(DltContextData *log, const ch DltReturnValue dlt_user_log_write_sized_utf8_string_attr(DltContextData *log, const char *text, uint16_t length, const char *name); /** + * Write a constant, null-terminated UTF8 string with "name" attribute into a DLT log message. + * In non-verbose mode, this parameter will not be sent at all. + * dlt_user_log_write_start has to be called before adding any parameters to the log message. + * Finish building a log message by calling dlt_user_log_write_finish. + * + * If @a name is NULL, this function will add an attribute field with length 0 + * and no content to the message. + * + * @param log pointer to an object containing information about logging context data + * @param text pointer to the parameter written into log message containing null termination + * @param name the "name" attribute (or NULL) + * @return value from DltReturnValue enum + */ +DltReturnValue dlt_user_log_write_constant_utf8_string_attr(DltContextData *log, const char *text, const char *name); + +/** + * Write a constant, potentially non-null-terminated UTF8 string with "name" attribute into a DLT log message. + * In non-verbose mode, this parameter will not be sent at all. + * dlt_user_log_write_start has to be called before adding any parameters to the log message. + * Finish building a log message by calling dlt_user_log_write_finish. + * + * If @a name is NULL, this function will add an attribute field with length 0 + * and no content to the message. + * + * @param log pointer to an object containing information about logging context data + * @param text pointer to the parameter written into log message + * @param length length in bytes of @a text (without any termination character) + * @param name the "name" attribute (or NULL) + * @return value from DltReturnValue enum + */ +DltReturnValue dlt_user_log_write_sized_constant_utf8_string_attr(DltContextData *log, const char *text, uint16_t length, const char *name); + +/** * Write a binary memory block into a DLT log message. * dlt_user_log_write_start has to be called before adding any attributes to the log message. * Finish sending log message by calling dlt_user_log_write_finish. |