<commit_before>#include <stdio.h>
#include "Fl_C.h"
#include "Fl_Types.h"

void my_callback(fl_Button b, void* user_data) {
  puts("The callback has been called!");
}
int main(int argc, char** argv)
{
  char* title = "FLTK Button Window";
  fl_Window win = (fl_Window)Fl_Window_New_WithTitle(500,500,title);
  fl_Button b = (fl_Button)Fl_Button_New_WithLabel(20,20,100,100,"Test Button");
  Fl_Button_set_callback(b, (fl_Callback*)my_callback);
  Fl_Window_end(win);
  Fl_Window_show(win);
  return flkc_run();
}<commit_msg>TIL printf buffers until it sees a newline character and hence saves all the non-newline terminated strings in the callbacks until the process is done at which point it barfs them to stdout. Printf now works in callbacks.<commit_after>#include <stdio.h>
#include "Fl_C.h"
#include "Fl_Types.h"

void callback_button1(fl_Button b1, void* user_data) {
  printf("%s %s\n", Fl_Button_label(b1), "has been clicked");
}
void callback_button2(fl_Button b2, void* user_data) {
  printf("%s %s\n", Fl_Button_label(b2), "has been clicked");
}

int main(int argc, char** argv)
{
  char* title = "FLTK Button Window";
  fl_Window win = (fl_Window)Fl_Window_New_WithTitle(500,500,title);
  fl_Button b1 = (fl_Button)Fl_Button_New_WithLabel(20,20,100,100,"Button 1");
  Fl_Button_set_callback(b1, (fl_Callback*)callback_button1);
  fl_Button b2 = (fl_Button)Fl_Button_New_WithLabel(130,20,100,100,"Button 2");
  Fl_Button_set_callback(b2, (fl_Callback*)callback_button2);
  Fl_Window_end(win);
  Fl_Window_show(win);
  return flkc_run();
}
{'fraction_non_alphanumeric': 0.1291155584247902, 'fraction_numerical': 0.036797934151065206, 'mean_word_length': 6.711442786069652, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6798054', 'n_tokens_mistral': 607, 'n_tokens_neox': 572, 'n_words': 133}