<commit_before>/****************************************************************************
**  MIPSim
**   
**  Copyright (c) 2010, <NAME>
**  All rights reserved.
**  
**  This file may be used under the terms of the BSD license.
**  Refer to the accompanying COPYING file.
****************************************************************************/

#include "io.h"

#include "config.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

int mipsim_open (int cxt, const char *path, int flags)
{
    return 0; //open(path, flags);
}

int mipsim_read (int cxt, int file, char *d, int len)
{
    return fread(d, sizeof(char), len, stdout);
}

int mipsim_write(int cxt, int file, char *d, int len)
{
    return fwrite(d, sizeof(char), len, stdout);
}

int mipsim_close(int cxt, int file)
{
    return 0; //close(file);
}

char mipsim_inbyte (int cxt)
{
    return fgetc(stdin);
}

void mipsim_outbyte(int cxt, char c)
{
//     putc(c);
}

int mipsim_printf(int cxt, const char *fmt, ...)
{
    int ret = 0;
    MIPSIM_Config *cfg = mipsim_config();
    
    va_list args;
    va_start(args, fmt);
    <commit_msg>Fixed monitor fread.<commit_after>/****************************************************************************
**  MIPSim
**   
**  Copyright (c) 2010, <NAME>
**  All rights reserved.
**  
**  This file may be used under the terms of the BSD license.
**  Refer to the accompanying COPYING file.
****************************************************************************/

#include "io.h"

#include "config.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

int mipsim_open (int cxt, const char *path, int flags)
{
    return 0; //open(path, flags);
}

int mipsim_read (int cxt, int file, char *d, int len)
{
    return fread(d, sizeof(char), len, stdin);
}

int mipsim_write(int cxt, int file, char *d, int len)
{
    return fwrite(d, sizeof(char), len, stdout);
}

int mipsim_close(int cxt, int file)
{
    return 0; //close(file);
}

char mipsim_inbyte (int cxt)
{
    return fgetc(stdin);
}

void mipsim_outbyte(int cxt, char c)
{
//     putc(c);
}

int mipsim_printf(int cxt, const char *fmt, ...)
{
    int ret = 0;
    MIPSIM_Config *cfg = mipsim_config();
    
    va_list args;
    va_start(args, fmt);
    
{'fraction_non_alphanumeric': 0.26108156028368795, 'fraction_numerical': 0.0062056737588652485, 'mean_word_length': 3.9065217391304348, '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': '5760917', 'n_tokens_mistral': 824, 'n_tokens_neox': 787, 'n_words': 232}