<commit_before>/*
 * author: <NAME> <<EMAIL>>
 */

#include "sink_null.hxx"
#include "istream.hxx"

#include <glib.h>

static size_t
sink_null_data(gcc_unused const void *data, size_t length,
               gcc_unused void *_ctx)
{
    return length;
}

static void
sink_null_eof(gcc_unused void *_ctx)
{
}

static void
sink_null_abort(GError *error, gcc_unused void *_ctx)
{
    g_error_free(error);
}

static constexpr struct istream_handler sink_null_handler = {
    .data = sink_null_data,
    .eof = sink_null_eof,
    .abort = sink_null_abort,
};

void
sink_null_new(struct istream *istream)
{
    istream_handler_set(istream, &sink_null_handler, NULL, 0);
}
<commit_msg>istream/sink_null: work around "non-trivial designated initializers not supported"<commit_after>/*
 * author: <NAME> <<EMAIL>>
 */

#include "sink_null.hxx"
#include "istream.hxx"

#include <glib.h>

static size_t
sink_null_data(gcc_unused const void *data, size_t length,
               gcc_unused void *_ctx)
{
    return length;
}

static void
sink_null_eof(gcc_unused void *_ctx)
{
}

static void
sink_null_abort(GError *error, gcc_unused void *_ctx)
{
    g_error_free(error);
}

static constexpr struct istream_handler sink_null_handler = {
    .data = sink_null_data,
    .direct = nullptr,
    .eof = sink_null_eof,
    .abort = sink_null_abort,
};

void
sink_null_new(struct istream *istream)
{
    istream_handler_set(istream, &sink_null_handler, NULL, 0);
}

{'fraction_non_alphanumeric': 0.11065006915629322, 'fraction_numerical': 0.0013831258644536654, 'mean_word_length': 4.319852941176471, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4007212', 'n_tokens_mistral': 570, 'n_tokens_neox': 564, 'n_words': 119}