stumpless_set_entry_message

Function stumpless_set_entry_message 

Source
pub unsafe extern "C" fn stumpless_set_entry_message(
    entry: *mut stumpless_entry,
    message: *const c_char,
    ...
) -> *mut stumpless_entry
Expand description

Sets the message of a given entry.

The message must be a valid format specifier string provided along with the appropriate number of variable arguments afterwards. This means that it should not be a user-controlled value under any circumstances. If you need a safer alternative without the risks of format strings, use \c stumpless_set_entry_message_str instead.

Thread Safety: MT-Safe This function is thread safe. A mutex is used to coordinate changes to the entry while it is being modified.

Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers due to the use of a non-reentrant lock to coordinate changes and the use of memory management functions to create the new message and free the old one.

Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of a lock that could be left locked as well as memory management functions.

@param entry The entry to modify.

@param message The new message to set on the entry. This message may contain any format specifiers valid in \c printf. If this is NULL, then it will be blank in the entry (no characters). This also means that characters such as % need to be escaped as they would be in printf. This must be a valid UTF-8 string in shortest form.

@param … Substitutions for any format specifiers provided in message. The number of substitutions provided must exactly match the number of specifiers given.

@return The modified entry if no error is encountered. If an error is encountered, then NULL is returned and an error code is set appropriately.