<commit_before>#include <fudge/module.h>
#include <kernel/vfs.h>
#include "system.h"
#include "protocol.h"

static unsigned int root(struct vfs_backend *backend)
{

    struct system_header header;

    backend->read(backend, 0, sizeof (struct system_header), &header);

    return (unsigned int)header.root;

}

static unsigned int parent(struct vfs_backend *backend, unsigned int id)
{

    struct system_node *node = (struct system_node *)id;

    return (unsigned int)node->parent;

}

static unsigned int match(struct vfs_backend *backend)
{

    struct system_header header;

    backend->read(backend, 0, sizeof (struct system_header), &header);

    return memory_match(header.id, "FUDGE_SYSTEM", 12);

}

static unsigned int open(struct vfs_backend *backend, unsigned int id)
{

    struct system_node *node = (struct system_node *)id;

    return node->open(node);

}

static unsigned int close(struct vfs_backend *backend, unsigned int id)
{

    struct system_node *node = (struct system_node *)id;

    return node->close(node);

}

static unsigned int read(struct vfs_backend *backend, unsigned int id, unsigned int offset, unsigned int count, void *buffer)
{

    struct system_node *node = (struct system_node *)id;

    return node->read(node, offset, count, buffer);

}

static unsigned int walk(struct vfs_backend *backend, unsigned int id, unsigned int count, const char *path)
{

    struct system_node *node = (struct system_node *)id;

    return node->walk(node, count, path);

}

static unsigned int write(struct vfs_backend *backend, unsigned int id, unsigned int offset, unsigned int count, void *buffer)
{

    struct system_node *node = (struct system_node *)id;

    return node->write(node, offset, count, buffer);

}

void system_init_protocol(struct vfs_protocol *protocol)
{

    vfs_init_protocol(protocol, match, root, open, close, read, write, parent, walk, 0);

}
<commit_msg>minor cleanup<commit_after>#include <fudge/module.h>
#include <kernel/vfs.h>
#include "system.h"
#include "protocol.h"

static unsigned int root(struct vfs_backend *backend)
{

    struct system_header header;

    backend->read(backend, 0, sizeof (struct system_header), &header);

    return (unsigned int)header.root;

}

static unsigned int parent(struct vfs_backend *backend, unsigned int id)
{

    struct system_node *node = (struct system_node *)id;

    return (unsigned int)node->parent;

}

static unsigned int match(struct vfs_backend *backend)
{

    struct system_header header;

    backend->read(backend, 0, sizeof (struct system_header), &header);

    return memory_match(header.id, "FUDGE_SYSTEM", 12);

}

static unsigned int open(struct vfs_backend *backend, unsigned int id)
{

    struct system_node *node = (struct system_node *)id;

    return node->open(node);

}

static unsigned int close(struct vfs_backend *backend, unsigned int id)
{

    struct system_node *node = (struct system_node *)id;

    return node->close(node);

}

static unsigned int read(struct vfs_backend *backend, unsigned int id, unsigned int offset, unsigned int count, void *buffer)
{

    struct system_node *node = (struct system_node *)id;

    return node->read(node, offset, count, buffer);

}

static unsigned int walk(struct vfs_backend *backend, unsigned int id, unsigned int count, const char *path)
{

    struct system_node *node = (struct system_node *)id;

    return node->walk(node, count, path);

}

static unsigned int write(struct vfs_backend *backend, unsigned int id, unsigned int offset, unsigned int count, void *buffer)
{

    struct system_node *node = (struct system_node *)id;

    return node->write(node, offset, count, buffer);

}

void system_init_protocol(struct vfs_protocol *protocol)
{

    memory_clear(protocol, sizeof (struct vfs_protocol));
    vfs_init_protocol(protocol, match, root, open, close, read, write, parent, walk, 0);

}

{'fraction_non_alphanumeric': 0.10705095213587236, 'fraction_numerical': 0.0025733401955738548, 'mean_word_length': 4.5528571428571425, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '1846981', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1167, 'n_words': 389}