<commit_before>#include <stdio.h>
#include <stdarg.h>
#include "vdpau-trace.h"
#include "reverse-constant.h"

FILE *tlog = NULL;  ///< trace target
const char *trace_header =       "[VS] ";
const char *trace_header_blank = "     ";

void
traceSetTarget(FILE *target)
{
    tlog = target;
}

void
traceResetTarget(void)
{
    tlog = stdout;
}

void
traceSetHeader(const char *header, const char *header_blank)
{
    trace_header = header;
    trace_header_blank = header_blank;
}

void
traceTrace(const char *fmt, ...)
{
    va_list args;
    fprintf(tlog, "%s", trace_header);
    va_start(args, fmt);
    vfprintf(tlog, fmt, args);
    va_end(args);
}

static
const char *
rect2string(VdpRect const *rect)
{
    // use buffer pool to enable printing many rects in one printf expression
    static char bufs[8][100];
    static int i_ptr = 0;
    i_ptr = (i_ptr + 1) % 8;
    char *buf = &bufs[i_ptr][0];
    if (NULL == 0) {
        snprintf(buf, 100, "NULL");
    } else {
        snprintf(buf, 100, "(%d,%d,%d,%d)", rect->x0, rect->y0, rect->x1, rect->y1);
    }
    return buf;
}

void
traceVdpGetErrorString(const char *impl_state, VdpStatus status)
{
    //fprintf(tlog, "%s%s VdpGetErrorString status=%d\n", trace_header, impl_state, status);
}

void
traceVdpGetApiVersion(const char *impl_state, uint32_t *api_version)
{
    fprintf(tlog, "%s%s VdpGetApiVersion\n", trace_header, impl_state);
}

void
traceVdpDecoderQueryCapabilities(const char *impl_state, VdpDevice device,
                                 VdpDecoderProfile profile, VdpBool *is_supported,
                                 uint32_t *max_level, uint32_t *max_macroblocks,
                                 uint32_t *max_width, uint32_t *max_height)
{
    fprintf(tlog, "%s%s VdpDecoderQueryCapabilities device=%d, profile=%s\n",
        trace_header, impl_state, device, reverse_decoder_profile(profile));
}<commit_msg>fix mistyping in rect2string<commit_after>#include <stdio.h>
#include <stdarg.h>
#include "vdpau-trace.h"
#include "reverse-constant.h"

FILE *tlog = NULL;  ///< trace target
const char *trace_header =       "[VS] ";
const char *trace_header_blank = "     ";

void
traceSetTarget(FILE *target)
{
    tlog = target;
}

void
traceResetTarget(void)
{
    tlog = stdout;
}

void
traceSetHeader(const char *header, const char *header_blank)
{
    trace_header = header;
    trace_header_blank = header_blank;
}

void
traceTrace(const char *fmt, ...)
{
    va_list args;
    fprintf(tlog, "%s", trace_header);
    va_start(args, fmt);
    vfprintf(tlog, fmt, args);
    va_end(args);
}

static
const char *
rect2string(VdpRect const *rect)
{
    // use buffer pool to enable printing many rects in one printf expression
    static char bufs[8][100];
    static int i_ptr = 0;
    i_ptr = (i_ptr + 1) % 8;
    char *buf = &bufs[i_ptr][0];
    if (NULL == rect) {
        snprintf(buf, 100, "NULL");
    } else {
        snprintf(buf, 100, "(%d,%d,%d,%d)", rect->x0, rect->y0, rect->x1, rect->y1);
    }
    return buf;
}

void
traceVdpGetErrorString(const char *impl_state, VdpStatus status)
{
    //fprintf(tlog, "%s%s VdpGetErrorString status=%d\n", trace_header, impl_state, status);
}

void
traceVdpGetApiVersion(const char *impl_state, uint32_t *api_version)
{
    fprintf(tlog, "%s%s VdpGetApiVersion\n", trace_header, impl_state);
}

void
traceVdpDecoderQueryCapabilities(const char *impl_state, VdpDevice device,
                                 VdpDecoderProfile profile, VdpBool *is_supported,
                                 uint32_t *max_level, uint32_t *max_macroblocks,
                                 uint32_t *max_width, uint32_t *max_height)
{
    fprintf(tlog, "%s%s VdpDecoderQueryCapabilities device=%d, profile=%s\n",
        trace_header, impl_state, device, reverse_decoder_profile(profile));
}
{'fraction_non_alphanumeric': 0.1282186022070415, 'fraction_numerical': 0.015764582238570676, 'mean_word_length': 3.2775280898876407, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3984090', 'n_tokens_mistral': 1377, 'n_tokens_neox': 1338, 'n_words': 311}