<commit_before>#include <stdlib.h> /* Provides exit */
#include <stdio.h> /* Provides printf, scanf, sscanf */
#include <unistd.h> /* Provides isatty */
#include "io_frontend.h"

int ISATTY;

/* Standard Input procedures **************/
_Bool _get_bool(FILE* file, char* n){
   char b[512];
   _Bool r = 0;
   int s = 1;
   char c;
   do {
      if(ISATTY) {
         if((s != 1)||(r == -1)) printf("\a");
         printf("%s (1,t,T/0,f,F) ? ", n);
      }
      if(scanf("%s", b)==EOF) exit(0);
      s = sscanf(b, "%c", &c);
      r = -1;
      if((c == '0') || (c == 'f') || (c == 'F')) r = 0;
      if((c == '1') || (c == 't') || (c == 'T')) r = 1;
   } while((s != 1) || (r == -1));
   fprintf(file, "%i\n",r);
   return r;
}

int _get_int(FILE* file, char* n){
   char b[512];
   int r;
   int s = 1;
   do {
      if(ISATTY) {
         if(s != 1) printf("\a");
         printf("%s (integer) ? ", n);
      }
      if(scanf("%s", b)==EOF) exit(0);
      s = sscanf(b, "%d", &r);
   } while(s != 1);
   fprintf(file, "%d\n", r);
   return r;
}

double _get_double(FILE* file, char* n){
   char b[512];
   double r;
   int s = 1;
   do {<commit_msg>_Bool are unsigned integer. The cast as a _Bool is delayed until the end of the function<commit_after>#include <stdlib.h> /* Provides exit */
#include <stdio.h> /* Provides printf, scanf, sscanf */
#include <unistd.h> /* Provides isatty */
#include "io_frontend.h"

int ISATTY;

/* Standard Input procedures **************/
_Bool _get_bool(FILE* file, char* n){
   char b[512];
   int r = 0;
   int s = 1;
   char c;
   do {
      if(ISATTY) {
         if((s != 1)||(r == -1)) printf("\a");
         printf("%s (1,t,T/0,f,F) ? ", n);
      }
      if(scanf("%s", b)==EOF) exit(0);
      s = sscanf(b, "%c", &c);
      r = -1;
      if((c == '0') || (c == 'f') || (c == 'F')) r = 0;
      if((c == '1') || (c == 't') || (c == 'T')) r = 1;
   } while((s != 1) || (r == -1));
   fprintf(file, "%i\n",r);
   return (_Bool)r;
}

int _get_int(FILE* file, char* n){
   char b[512];
   int r;
   int s = 1;
   do {
      if(ISATTY) {
         if(s != 1) printf("\a");
         printf("%s (integer) ? ", n);
      }
      if(scanf("%s", b)==EOF) exit(0);
      s = sscanf(b, "%d", &r);
   } while(s != 1);
   fprintf(file, "%d\n", r);
   return r;
}

double _get_double(FILE* file, char* n){
   char b[512];
   double r;
   int s = 1;
   do {
{'fraction_non_alphanumeric': 0.25104777870913664, 'fraction_numerical': 0.02347024308466052, 'mean_word_length': 2.26986301369863, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7110674', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1011, 'n_words': 266}