<commit_before>#include <node.h>
#include <v8.h>
#include <uv.h>

#include "../INCHI-1-API/INCHI_API/inchi_dll/inchi_api.h"
#include "../INCHI-1-API/INCHI_API/inchi_dll/mode.h"

using namespace v8;

/**
 * this is the direct wrapper of the low-level C++ api
 * 
 * @module InChI
 * @class  InChILib
 */


Handle<Value> StructureToInChI(const Arguments& args) {
  HandleScope scope;
  return scope.Close(String::New("world"));

  // build INCHI_Input structure from args

  //

}

Handle<Value> getAlgorithmVersion(const Arguments& args) {
  HandleScope scope;
  return scope.Close(String::New(INCHI_VERSION));
}


void init(Handle<Object> exports) {
  exports->Set(String::NewSymbol("getAlgorithmVersion"),
               FunctionTemplate::New(getAlgorithmVersion)->GetFunction());
}

NODE_MODULE(libinchi, init)<commit_msg>add and document old-style return codes<commit_after>#include <node.h>
#include <v8.h>
#include <uv.h>

#include "inchi_dll/inchi_api.h"
#include "inchi_dll/mode.h"

using namespace v8;

/**
 * Direct wrapper of the low-level C++ api
 *
 * http://www.inchi-trust.org/fileadmin/user_upload/software/inchi-v1.04/InChI_API_Reference.pdf
 *
 * @module InChI
 * @class  InChILib
 */


/**
 * Returns the current version of the InChI algorithm
 * @method getAlgorithmVersion
 * @return {String} current algorithm version (from INCHI_VERSION)
 */
Handle<Value> getAlgorithmVersion(const Arguments& args) {
  HandleScope scope;
  return scope.Close(String::New(INCHI_VERSION));
}


void init(Handle<Object> exports) {
  exports->Set(String::NewSymbol("getAlgorithmVersion"),
               FunctionTemplate::New(getAlgorithmVersion)->GetFunction());
  
  /**
   * Return codes for the GetINCHI/GetStdINCHI (old-style) functions
   * @module InChI
   * @class RetValGetInchi
   */

  /**
   * Success; no errors or warnings
   * @property {int} inchi_Ret_OKAY
   * @final
   */
  exports->Set(String::NewSymbol("inchi_Ret_OKAY"), Number::New(inchi_Ret_OKAY));

  /**
   * Success; warning(s) issued
   * @property {int} inchi_Ret_WARNING
   * @final
   */
  exports->Set(String::NewSymbol("inchi_Ret_WARNING"), Number::New(inchi_Ret_WARNING));

  /**
   * Error: no InCHI has been created
   * @property {int} inchi_Ret_ERROR
   * @final
   */
  exports->Set(String::NewSymbol("inchi_Ret_ERROR"), Number::New(inchi_Ret_ERROR));

  /**
   * Severe error: no InCHI has been created (typically, memory allocation failure)
   * @property {int} inchi_Ret_FATAL
   * @final
   */
  exports->Set(String::NewSymbol("inchi_Ret_FATAL"), Number::New(inchi_Ret_FATAL));

  /**
   * Unknown program error
   * @property {int} inchi_Ret_UNKNOWN
   * @final
   */
  exports->Set(String::NewSymbol("inchi_Ret_UNKNOWN"), Number::New(inchi_Ret_UNKNOWN));

  /**
   * Previous call to InChI has not returned yet
   * @property {int} inchi_Ret_BUSY
   * @final
   */
  exports->Set(String::NewSymbol("inchi_Ret_BUSY"), Number::New(inchi_Ret_BUSY));

  /**
   * no structural data has been provided
   * @property {int} inchi_Ret_EOF
   * @final
   */
  exports->Set(String::NewSymbol("inchi_Ret_EOF"), Number::New(inchi_Ret_EOF));


}
NODE_MODULE(libinchi, init)
{'fraction_non_alphanumeric': 0.1444409249287298, 'fraction_numerical': 0.0028508077288565093, 'mean_word_length': 4.316498316498317, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '4580260', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1098, 'n_words': 211}