<commit_before>
#include <malloc.h>
#include <stdio.h>

#include "file.h"

FILE_H *file_open_linux(const char* filename, const char *mode);
void file_close_linux(FILE_H *file);
int64_t file_seek_linux(FILE_H *file, int64_t offset, int32_t origin);
int64_t file_tell_linux(FILE_H *file);
int file_read_linux(FILE_H *file, uint8_t *buf, int64_t size);
int file_write_linux(FILE_H *file, uint8_t *buf, int64_t size);


void file_close_linux(FILE_H *file)
{
    fclose((FILE *)file->internal);
}

int64_t file_seek_linux(FILE_H *file, int64_t offset, int32_t origin)
{
    return fseek((FILE *)file->internal, offset, origin);
}

int64_t file_tell_linux(FILE_H *file)
{
    return ftell((FILE *)file->internal);
}

int file_read_linux(FILE_H *file, uint8_t *buf, int64_t size)
{
    return fread(buf, size, 1, (FILE *)file->internal);
}

int file_write_linux(FILE_H *file, uint8_t *buf, int64_t size)
{
    return fwrite(buf, size, 1, (FILE *)file->internal);
}

FILE_H *file_open_linux(const char* filename, const char *mode)
{
    FILE *fp = NULL;
    FILE_H *file = malloc(sizeof(FILE_H));

    file->close = file_close_linux;
    file->seek = file_seek_linux;
    file->read = file_read_linux;
    file->write = file_write_linux;
    file->tell = file_tell_linux;

    if ((fp = fopen(filename, mode))) {
        file->internal = fp;
<commit_msg>mmc, aacs_sign, mkb/file use of file abstraction layer<commit_after>
#include <malloc.h>
#include <stdio.h>

#include "file.h"

FILE_H *file_open_linux(const char* filename, const char *mode);
void file_close_linux(FILE_H *file);
int64_t file_seek_linux(FILE_H *file, int64_t offset, int32_t origin);
int64_t file_tell_linux(FILE_H *file);
int file_read_linux(FILE_H *file, uint8_t *buf, int64_t size);
int file_write_linux(FILE_H *file, uint8_t *buf, int64_t size);


void file_close_linux(FILE_H *file)
{
    fclose((FILE *)file->internal);
}

int64_t file_seek_linux(FILE_H *file, int64_t offset, int32_t origin)
{
    return fseek((FILE *)file->internal, offset, origin);
}

int64_t file_tell_linux(FILE_H *file)
{
    return ftell((FILE *)file->internal);
}

int file_read_linux(FILE_H *file, uint8_t *buf, int64_t size)
{
    return fread(buf, 1, size, (FILE *)file->internal);
}

int file_write_linux(FILE_H *file, uint8_t *buf, int64_t size)
{
    return fwrite(buf, 1, size, (FILE *)file->internal);
}

FILE_H *file_open_linux(const char* filename, const char *mode)
{
    FILE *fp = NULL;
    FILE_H *file = malloc(sizeof(FILE_H));

    file->close = file_close_linux;
    file->seek = file_seek_linux;
    file->read = file_read_linux;
    file->write = file_write_linux;
    file->tell = file_tell_linux;

    if ((fp = fopen(filename, mode))) {
        file->internal = fp;

{'fraction_non_alphanumeric': 0.13355287230150018, 'fraction_numerical': 0.021953896816684963, 'mean_word_length': 4.9564270152505445, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, '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': '5862234', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1047, 'n_words': 245}