<commit_before>=begin
Copyright © 2010 <NAME> <<EMAIL>>

Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
=end
module GSSAPI
  module LibGSSAPI

    class GssOID < FFI::Struct
      layout  :length, :OM_uint32,
        :elements, :pointer # pointer of :void

      def self.gss_c_no_oid
        self.new(GSSAPI::LibGSSAPI::GSS_C_NO_OID)
      end
    end


    def self.load_mit
      case RUBY_PLATFORM
      when /linux/
        gssapi_lib = 'libgssapi_krb5.so.2'
      when /darwin/
        gssapi_lib = '/usr/lib/libgssapi_krb5.dylib'
      when /mswin|mingw32|windows/
        # Pull the gssapi32 path from the environment if it exist, otherwise use the default in Program Files
        gssapi32_path = ENV['gssapi32'] ? ENV['gssapi32'] : 'C:\Program Files (x86)\MIT\Kerberos\bin\gssapi32.dll'
        ffi_lib gssapi32_path, FFI::Library::LIBC  # Required the MIT Kerberos libraries to be installed
        ffi_convention :stdcall
      else
        raise LoadError, "This platform (#{RUBY_PLATFORM}) is not supported by ruby gssapi and the MIT libraries."
      end
      ffi_lib gssapi_lib, FFI::Library::LIBC

      # -------------------- MIT Specifics -------------------- 
      attach_variable :__GSS_C_NT_HOSTBASED_SERVICE, :GSS_C_NT_HOSTBASED_SERVICE, :pointer # type gss_OID
      attach_variable :__GSS_C_NT_EXPORT_NAME, :GSS_C_NT_EXPORT_NAME, :pointer # type gss_OID
      LibGSSAPI.const_set("GSS_C_NT_HOSTBASED_SERVICE", __GSS_C_NT_HOSTBASED_SERVICE)
      LibGSSAPI.const_set("GSS_C_NT_EXPORT_NAME", __GSS_C_NT_EXPORT_NAME)
    end

    def self.load_heimdal
      case RUBY_PLATFORM
      when /linux/
        gssapi_lib = 'libgssapi.so.3'
      when /darwin/
        # use Heimdal Kerberos since Mac MIT Kerberos is OLD. Do a "require 'gssapi/heimdal'" first
        gssapi_lib = '/usr/heimdal/lib/libgssapi.dylib'<commit_msg>do not reload the libc on windows platforms<commit_after>=begin
Copyright © 2010 <NAME> <<EMAIL>>

Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
=end
module GSSAPI
  module LibGSSAPI

    class GssOID < FFI::Struct
      layout  :length, :OM_uint32,
        :elements, :pointer # pointer of :void

      def self.gss_c_no_oid
        self.new(GSSAPI::LibGSSAPI::GSS_C_NO_OID)
      end
    end


    def self.load_mit
      case RUBY_PLATFORM
      when /linux/
        gssapi_lib = 'libgssapi_krb5.so.2'
        ffi_lib gssapi_lib, FFI::Library::LIBC
      when /darwin/
        gssapi_lib = '/usr/lib/libgssapi_krb5.dylib'
        ffi_lib gssapi_lib, FFI::Library::LIBC
      when /mswin|mingw32|windows/
        # Pull the gssapi32 path from the environment if it exist, otherwise use the default in Program Files
        gssapi32_path = ENV['gssapi32'] ? ENV['gssapi32'] : 'C:\Program Files (x86)\MIT\Kerberos\bin\gssapi32.dll'
        ffi_lib gssapi32_path, FFI::Library::LIBC  # Required the MIT Kerberos libraries to be installed
        ffi_convention :stdcall
      else
        raise LoadError, "This platform (#{RUBY_PLATFORM}) is not supported by ruby gssapi and the MIT libraries."
      end

      # -------------------- MIT Specifics -------------------- 
      attach_variable :__GSS_C_NT_HOSTBASED_SERVICE, :GSS_C_NT_HOSTBASED_SERVICE, :pointer # type gss_OID
      attach_variable :__GSS_C_NT_EXPORT_NAME, :GSS_C_NT_EXPORT_NAME, :pointer # type gss_OID
      LibGSSAPI.const_set("GSS_C_NT_HOSTBASED_SERVICE", __GSS_C_NT_HOSTBASED_SERVICE)
      LibGSSAPI.const_set("GSS_C_NT_EXPORT_NAME", __GSS_C_NT_EXPORT_NAME)
    end

    def self.load_heimdal
      case RUBY_PLATFORM
      when /linux/
        gssapi_lib = 'libgssapi.so.3'
      when /darwin/
        # use Heimdal Kerberos since Mac MIT Kerberos is OLD. Do a "require 'gssapi/heimdal'" first
        gssapi_lib = '/usr/heimdal/lib/libgssapi.dylib'
{'fraction_non_alphanumeric': 0.10439989586045301, 'fraction_numerical': 0.013538141109086176, 'mean_word_length': 2.8690835850956695, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4309193', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1380, 'n_words': 305}