<commit_before>
/**
 * Implementation of errno. This is a #define :/
 * On Linux, it's a global variable with the symbol `errno`,
 * but on Darwin it's a method execution called `__error`.
 */

var ffi = require('./ffi')
  , ref = require('ref')
  , errnoPtr = null
  , intType = ref.types.int
  , intPtrType = ref.refType(intType)

if (process.platform == 'darwin' || process.platform == 'mac') {
  var __error = new ffi.DynamicLibrary().get('__error')
  errnoPtr = ffi.ForeignFunction(__error, intPtrType, [])
} else if (process.platform == 'win32') {
  var _errno = new ffi.DynamicLibrary('msvcrt.dll').get('_errno')
  errnoPtr = ffi.ForeignFunction(_errno, intPtrType, [])
} else {  // linux, sunos, etc.
  var errnoGlobal = new ffi.DynamicLibrary().get('errno');
  errnoPtr = function () { return errnoGlobal }
  // set the errno type
  errnoPtr.type = ref.types.int
}


function errno () {
  return errnoPtr().deref()
}
module.exports = errno<commit_msg>variable name cleanup<commit_after>
/**
 * Implementation of errno. This is a #define :/
 * On Linux, it's a global variable with the symbol `errno`,
 * but on Darwin it's a method execution called `__error`.
 */

var ffi = require('./ffi')
  , ref = require('ref')
  , errnoPtr = null
  , int = ref.types.int
  , intPtr = ref.refType(int)

if (process.platform == 'darwin' || process.platform == 'mac') {
  var __error = new ffi.DynamicLibrary().get('__error')
  errnoPtr = ffi.ForeignFunction(__error, intPtr, [])
} else if (process.platform == 'win32') {
  var _errno = new ffi.DynamicLibrary('msvcrt.dll').get('_errno')
  errnoPtr = ffi.ForeignFunction(_errno, intPtr, [])
} else {  // linux, sunos, etc.
  var errnoGlobal = new ffi.DynamicLibrary().get('errno');
  errnoPtr = function () { return errnoGlobal }
  // set the errno type
  errnoPtr.type = int
}


function errno () {
  return errnoPtr().deref()
}
module.exports = errno
{'fraction_non_alphanumeric': 0.1559536354056902, 'fraction_numerical': 0.002107481559536354, 'mean_word_length': 3.8817480719794344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6146227', 'n_tokens_mistral': 654, 'n_tokens_neox': 613, 'n_words': 171}