BIO *OSSL_trace_begin(int category)
{
    BIO *channel = NULL;
#ifndef OPENSSL_NO_TRACE
    char *prefix = NULL;
    category = ossl_trace_get_category(category);
    channel = trace_channels[category].bio;
    prefix = trace_channels[category].prefix;
    if (channel != NULL) {
        CRYPTO_THREAD_write_lock(trace_lock);
        current_channel = channel;
        switch (trace_channels[category].type) {
        case t_channel:
            if (prefix != NULL) {
                (void)BIO_puts(channel, prefix);
                (void)BIO_puts(channel, "\n");
            }
            break;
        case t_callback:
            (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_BEGIN,
                           prefix == NULL ? 0 : strlen(prefix), prefix);
            break;
        }
    }
#endif
    return channel;
}
['BIO *OSSL_trace_begin(int category)\n{\n    BIO *channel = NULL;\n#ifndef OPENSSL_NO_TRACE\n    char *prefix = NULL;\n    category = ossl_trace_get_category(category);\n    channel = trace_channels[category].bio;\n    prefix = trace_channels[category].prefix;\n    if (channel != NULL) {\n        CRYPTO_THREAD_write_lock(trace_lock);\n        current_channel = channel;\n        switch (trace_channels[category].type) {\n        case t_channel:\n            if (prefix != NULL) {\n                (void)BIO_puts(channel, prefix);\n                (void)BIO_puts(channel, "\\n");\n            }\n            break;\n        case t_callback:\n            (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_BEGIN,\n                           prefix == NULL ? 0 : strlen(prefix), prefix);\n            break;\n        }\n    }\n#endif\n    return channel;\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}']