void OSSL_trace_end(int category, BIO * channel)
{
#ifndef OPENSSL_NO_TRACE
    char *suffix = NULL;
    category = ossl_trace_get_category(category);
    suffix = trace_channels[category].suffix;
    if (channel != NULL
        && ossl_assert(channel == current_channel)) {
        (void)BIO_flush(channel);
        switch (trace_channels[category].type) {
        case t_channel:
            if (suffix != NULL) {
                (void)BIO_puts(channel, suffix);
                (void)BIO_puts(channel, "\n");
            }
            break;
        case t_callback:
            (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_END,
                           suffix == NULL ? 0 : strlen(suffix), suffix);
            break;
        }
        current_channel = NULL;
        CRYPTO_THREAD_unlock(trace_lock);
    }
#endif
}
['void OSSL_trace_end(int category, BIO * channel)\n{\n#ifndef OPENSSL_NO_TRACE\n    char *suffix = NULL;\n    category = ossl_trace_get_category(category);\n    suffix = trace_channels[category].suffix;\n    if (channel != NULL\n        && ossl_assert(channel == current_channel)) {\n        (void)BIO_flush(channel);\n        switch (trace_channels[category].type) {\n        case t_channel:\n            if (suffix != NULL) {\n                (void)BIO_puts(channel, suffix);\n                (void)BIO_puts(channel, "\\n");\n            }\n            break;\n        case t_callback:\n            (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_END,\n                           suffix == NULL ? 0 : strlen(suffix), suffix);\n            break;\n        }\n        current_channel = NULL;\n        CRYPTO_THREAD_unlock(trace_lock);\n    }\n#endif\n}', 'static int ossl_trace_get_category(int category)\n{\n    if (category < 0 || category >= OSSL_TRACE_CATEGORY_NUM)\n        return -1;\n    if (trace_channels[category].bio != NULL)\n        return category;\n    return OSSL_TRACE_CATEGORY_ANY;\n}']