<commit_before>#include <abi.h>
#include <fudge.h>

static unsigned int quit;

static void complete(struct event_header *header, unsigned int descriptor, void *name, unsigned int length)
{

    struct record record;

    file_open(descriptor);

    while (file_readall(descriptor, &record, sizeof (struct record)))
    {

        if (length < record.length && memory_match(record.name, name, length))
        {

            char message[FUDGE_BSIZE];
            char buffer[FUDGE_BSIZE];
            unsigned int count = 0;

            count += memory_write(buffer, FUDGE_BSIZE, record.name, record.length, count);
            count += memory_write(buffer, FUDGE_BSIZE, "\n", 1, count);

            event_addresponse(message, header, EVENT_DATA);
            event_adddata(message, count, buffer);
            event_send(message);

        }

        if (!file_step(descriptor))
            break;

    }

    file_close(descriptor);

}

static void onkill(struct event_header *header)
{

    char message[FUDGE_BSIZE];

    event_addresponse(message, header, EVENT_CHILD);
    event_send(message);

    quit = 1;

}

static void ondata(struct event_header *header)
{

    struct event_data *data = event_getdata(header);

    complete(header, FILE_PW, data + 1, data->count);<commit_msg>more work<commit_after>#include <abi.h>
#include <fudge.h>

static unsigned int quit;

static void complete(struct event_header *header, unsigned int descriptor, void *name, unsigned int length)
{

    char message[FUDGE_BSIZE];
    char buffer[FUDGE_BSIZE];
    unsigned int count = 0;
    struct record record;

    file_open(descriptor);

    while (file_readall(descriptor, &record, sizeof (struct record)))
    {

        if (length < record.length && memory_match(record.name, name, length))
        {

            count += memory_write(buffer, FUDGE_BSIZE, record.name, record.length, count);
            count += memory_write(buffer, FUDGE_BSIZE, "\n", 1, count);

        }

        if (!file_step(descriptor))
            break;

    }

    file_close(descriptor);
    event_addresponse(message, header, EVENT_DATA);
    event_adddata(message, count, buffer);
    event_send(message);

}

static void onkill(struct event_header *header)
{

    char message[FUDGE_BSIZE];

    event_addresponse(message, header, EVENT_CHILD);
    event_send(message);

    quit = 1;

}

static void ondata(struct event_header *header)
{

    struct event_data *data = event_getdata(header);

    complete(header, FILE_PW, data + 1, data->count);
{'fraction_non_alphanumeric': 0.10917721518987342, 'fraction_numerical': 0.0031645569620253164, 'mean_word_length': 3.1459016393442623, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1508948', 'n_tokens_mistral': 802, 'n_tokens_neox': 763, 'n_words': 190}