<commit_before>
#include "stringutil.c"
#include "expression_parser.h"


typedef int (*edscript_function)(char *parameters[]);

struct command{
  int line; 
  char **parameters;
  char *function_name;
  edscript_function func;
} command;



struct command *commands;
int commands_count = 0;


void append_command(struct command c)
{
    commands_count = commands_count + 1;
    commands = malloc(sizeof(c) * commands_count);
    commands[commands_count - 1] = c;
}

void parse_command(char *line, int line_number)
{
    return;
}


// ========================== script functions ===============


edscript_function print;
edscript_function read_file;
edscript_function query;
edscript_function execute;

int _print(char *parameters[])
{
    
    return 0;
}<commit_msg>Migration do C<commit_after>
#include "stringutil.c"
#include "expression_parser/code/expression_parser.h"



struct st_command{
  int line; 
  int level;
  char **parameters;
  char *function_name;
  struct st_command *childrens;
  int (*func)(struct st_command *c, char **parameters);
} command;


typedef int (*edscript_function)(struct st_command *_c, char **parameters);

int _print(struct st_command *c, char *parameters[]);

struct st_command *commands;
int commands_count = 0;


void append_command(struct st_command *c)
{
    commands_count = commands_count + 1;
    if(commands_count == 0)
    {
        commands = malloc(sizeof(command));
    }
    else
    {
        realloc(commands, sizeof(c) * commands_count);
    }
    commands[commands_count - 1].line         = c->line;
    commands[commands_count - 1].level        = c->level;
    // commands[commands_count - 1].parameters   = c->parameters;
    // commands[commands_count - 1].function_name= c->function_name;
    // commands[commands_count - 1].childrens    = c->childrens;
}

/**
 * Retorna 0 caso tenha conseguido fazer o parse do comando corretamente
 *
 *
 *
 */
int parse_command(char *line, int line_number)
{
    int i = 0;
    int _spaces = 0;
    struct st_command _command;
    _command.level = 0;
    while(line[i] != 0) 
    {

        
        if(line[i] == 32)
        {
            _spaces = _spaces + 1;
        }
        i = i + 1;
    }
    return 0;
}


// ========================== script functions ===============


edscript_function read_file;
edscript_function query;
edscript_function execute;

int _print(struct st_command *c, char *parameters[])
{
    
    return 0;
}

{'fraction_non_alphanumeric': 0.1431501230516817, 'fraction_numerical': 0.009433962264150943, 'mean_word_length': 3.3945945945945946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '4457325', 'n_tokens_mistral': 821, 'n_tokens_neox': 763, 'n_words': 191}