<commit_before>/**
 * @file ${FILE}
 * @brief
 * @license ${LICENSE}
 * Copyright (c) 11/11/15, Steven
 *
 **/
#include <dangerengine.h>

#ifndef __EMSCRIPTEN__

int main(int argc, char **argv)
{
  slsContext *ctx = sls_context_new("hello world!", 640, 640);

  if (ctx) {
    sls_context_run(ctx);
  }
  free(sls_context_dtor(ctx));
  return 0;
}


#else

#include <SDL2/SDL.h>
#include <stdlib.h>

#include <pthread.h>

static void *thread_fn(void *_)
{
  printf("hello!!! from thread\n");
  return NULL;
}

/**
 * Emscripten entry point
 **/

int main(int argc, char **argv){
  int res =  SDL_Init(SDL_INIT_VIDEO);
  #define N_THREADS 10
  pthread_t threads[N_THREADS];
  for(int i=0; i<N_THREADS; ++i){
    pthread_create(threads + i, NULL, thread_fn, NULL);
  }

  atexit(SDL_Quit);
  printf("hello world!!! %i\n", res);

  return 0;
}
#endif // !__EMSCRIPTEN__

<commit_msg>removed pthread demo from emscripten main function<commit_after>/**
 * @file ${FILE}
 * @brief
 * @license ${LICENSE}
 * Copyright (c) 11/11/15, Steven
 *
 **/
#include <dangerengine.h>

#ifndef __EMSCRIPTEN__

int main(int argc, char** argv)
{
  slsContext* ctx = sls_context_new("hello world!", 640, 640);

  if (ctx) {
    sls_context_run(ctx);
  }
  free(sls_context_dtor(ctx));
  return 0;
}

#else

#include <SDL2/SDL.h>
#include <emscripten.h>
#include <stdlib.h>
#include <stdbool.h>

/**
 * Emscripten entry point
 **/

static int n = 0;

static void em_loop_fn(void)
{
  char buff[100];
  fgets(buff, 100, stdin);
  buff[99] = '\0';

  printf("hello %i %s!!!\n", n, buff);
  
  if(n++>= 100){
    emscripten_cancel_main_loop();
  }
}

int main(int argc, char** argv)
{
  int res = SDL_Init(SDL_INIT_VIDEO);
  emscripten_set_main_loop(em_loop_fn, 50, false);

  return 0;
}
#endif // !__EMSCRIPTEN__
{'fraction_non_alphanumeric': 0.17058165548098433, 'fraction_numerical': 0.026845637583892617, 'mean_word_length': 3.9694444444444446, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5765946', 'n_tokens_mistral': 795, 'n_tokens_neox': 740, 'n_words': 166}