<commit_before>#include "ffi.h"

///////////////

void FFI::InitializeStaticFunctions(Handle<Object> target) {
  Local<Object> o = Object::New();

  // abs and atoi here for testing purposes
  // Temporarily commented out for Windows...
  // "cannot convert from overloaded function to unsigned char *"
  //o->Set(String::New("abs"), Pointer::WrapPointer((unsigned char *)abs));
  //o->Set(String::New("atoi"), Pointer::WrapPointer((unsigned char *)atoi));
  o->Set(String::New("dlopen"), Pointer::WrapPointer((unsigned char *)dlopen));
  o->Set(String::New("dlclose"), Pointer::WrapPointer((unsigned char *)dlclose));
  o->Set(String::New("dlsym"), Pointer::WrapPointer((unsigned char *)dlsym));
  o->Set(String::New("dlerror"), Pointer::WrapPointer((unsigned char *)dlerror));

  target->Set(String::NewSymbol("StaticFunctions"), o);
}

///////////////

void FFI::InitializeBindings(Handle<Object> target) {
  Local<Object> o = Object::New();

  target->Set(String::New("free"), FunctionTemplate::New(Free)->GetFunction());<commit_msg>Re-enable the static 'atoi' and 'abs' bindings, even on Windows.<commit_after>#include "ffi.h"

///////////////

void FFI::InitializeStaticFunctions(Handle<Object> target) {
  Local<Object> o = Object::New();

  // atoi and abs here for testing purposes
  o->Set(String::New("atoi"), Pointer::WrapPointer((unsigned char *)atoi));
  // Windows has multiple `abs` signatures, so we need to manually disambiguate
  int (*absPtr)(int)(abs);
  o->Set(String::New("abs"), Pointer::WrapPointer((unsigned char *)absPtr));

  // dl functions used by the DynamicLibrary JS class
  o->Set(String::New("dlopen"), Pointer::WrapPointer((unsigned char *)dlopen));
  o->Set(String::New("dlclose"), Pointer::WrapPointer((unsigned char *)dlclose));
  o->Set(String::New("dlsym"), Pointer::WrapPointer((unsigned char *)dlsym));
  o->Set(String::New("dlerror"), Pointer::WrapPointer((unsigned char *)dlerror));

  target->Set(String::NewSymbol("StaticFunctions"), o);
}

///////////////

void FFI::InitializeBindings(Handle<Object> target) {
  Local<Object> o = Object::New();

  target->Set(String::New("free"), FunctionTemplate::New(Free)->GetFunction());
{'fraction_non_alphanumeric': 0.21527138914443422, 'fraction_numerical': 0.0, 'mean_word_length': 5.570996978851964, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, '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': '7673886', 'n_tokens_mistral': 649, 'n_tokens_neox': 641, 'n_words': 141}