<commit_before>#include <fudge.h>
#include <format/cpio.h>
#include "resource.h"
#include "binary.h"
#include "task.h"
#include "service.h"

static struct service_protocol protocol;

static struct cpio_header *getheader(struct service_backend *backend, unsigned int id)
{

    struct cpio_header *header = (struct cpio_header *)backend->map(id, sizeof (struct cpio_header));

    return (cpio_validate(header)) ? header : 0;

}

static char *getname(struct cpio_header *header)
{

    return (char *)(header + 1);

}

static unsigned int parent(struct service_backend *backend, struct cpio_header *header, unsigned int id)
{

    struct cpio_header *eheader;
    unsigned int length = memory_findlastbyte(getname(header), header->namesize - 1, '/');
    unsigned int current = id;

    do
    {

        eheader = getheader(backend, current);

        if (!eheader)
            break;

        if ((eheader->mode & 0xF000) != 0x4000)
            continue;

        if (eheader->namesize == length + 1)
            return current;

    } while ((current = cpio_next(eheader, current)));

    return id;

}

static unsigned int child(struct service_backend *backend, struct cpio_header *header, unsigned int id, char *path, unsigned int length)
{

    struct cpio_header *eheader;
    unsigned int current = 0;

    do
    {

        if (current == id)
            break;
<commit_msg>remove unused thing<commit_after>#include <fudge.h>
#include <format/cpio.h>
#include "resource.h"
#include "binary.h"
#include "task.h"
#include "service.h"

static struct service_protocol protocol;

static struct cpio_header *getheader(struct service_backend *backend, unsigned int id)
{

    struct cpio_header *header = (struct cpio_header *)backend->map(id, sizeof (struct cpio_header));

    return (cpio_validate(header)) ? header : 0;

}

static char *getname(struct cpio_header *header)
{

    return (char *)(header + 1);

}

static unsigned int parent(struct service_backend *backend, struct cpio_header *header, unsigned int id)
{

    struct cpio_header *eheader;
    unsigned int length = memory_findlastbyte(getname(header), header->namesize - 1, '/');
    unsigned int current = id;

    do
    {

        eheader = getheader(backend, current);

        if (!eheader)
            break;

        if ((eheader->mode & 0xF000) != 0x4000)
            continue;

        if (eheader->namesize == length + 1)
            return current;

    } while ((current = cpio_next(eheader, current)));

    return id;

}

static unsigned int child(struct service_backend *backend, struct cpio_header *header, unsigned int id, char *path, unsigned int length)
{

    struct cpio_header *eheader;
    unsigned int current = 0;

    do
    {

{'fraction_non_alphanumeric': 0.11127432978332721, 'fraction_numerical': 0.010282776349614395, 'mean_word_length': 3.2762951334379906, 'pattern_counts': {'":': 0, '<': 7, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '485027', 'n_tokens_mistral': 876, 'n_tokens_neox': 824, 'n_words': 248}