<commit_before># frozen_string_literal: true

require "ffi"
require "ffi/bit_masks"

module GObjectIntrospection
  # Module for attaching functions from the girepository library
  module Lib
    extend FFI::Library
    extend FFI::BitMasks
    ffi_lib "girepository-1.0"

    # IRepository
    enum :IRepositoryLoadFlags, [:LAZY, (1 << 0)]

    attach_function :g_irepository_get_default, [], :pointer
    attach_function :g_irepository_prepend_search_path, [:string], :void
    attach_function :g_irepository_require,
                    [:pointer, :string, :string, :IRepositoryLoadFlags, :pointer],
                    :pointer
    attach_function :g_irepository_get_version, [:pointer, :string], :string

    attach_function :g_irepository_get_n_infos, [:pointer, :string], :int
    attach_function :g_irepository_get_info, [:pointer, :string, :int], :pointer
    attach_function :g_irepository_find_by_name, [:pointer, :string, :string], :pointer
    attach_function :g_irepository_find_by_gtype, [:pointer, :size_t], :pointer
    attach_function :g_irepository_get_dependencies, [:pointer, :string], :pointer
    attach_function :g_irepository_get_shared_library, [:pointer, :string], :string

    # IBaseInfo
    enum :IInfoType, [
      :invalid,
      :function,<commit_msg>Load library in a way that does not require dev package<commit_after># frozen_string_literal: true

require "ffi"
require "ffi/bit_masks"

module GObjectIntrospection
  # Module for attaching functions from the girepository library
  module Lib
    extend FFI::Library
    extend FFI::BitMasks
    ffi_lib "girepository-1.0.so.1"

    # IRepository
    enum :IRepositoryLoadFlags, [:LAZY, (1 << 0)]

    attach_function :g_irepository_get_default, [], :pointer
    attach_function :g_irepository_prepend_search_path, [:string], :void
    attach_function :g_irepository_require,
                    [:pointer, :string, :string, :IRepositoryLoadFlags, :pointer],
                    :pointer
    attach_function :g_irepository_get_version, [:pointer, :string], :string

    attach_function :g_irepository_get_n_infos, [:pointer, :string], :int
    attach_function :g_irepository_get_info, [:pointer, :string, :int], :pointer
    attach_function :g_irepository_find_by_name, [:pointer, :string, :string], :pointer
    attach_function :g_irepository_find_by_gtype, [:pointer, :size_t], :pointer
    attach_function :g_irepository_get_dependencies, [:pointer, :string], :pointer
    attach_function :g_irepository_get_shared_library, [:pointer, :string], :string

    # IBaseInfo
    enum :IInfoType, [
      :invalid,
      :function,
{'fraction_non_alphanumeric': 0.10256410256410256, 'fraction_numerical': 0.003444316877152698, 'mean_word_length': 4.621505376344086, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3814362', 'n_tokens_mistral': 849, 'n_tokens_neox': 852, 'n_words': 185}