<commit_before>require 'ffi'

module Ragweed; end
module Ragweed::Wraposx

  module Libc
    extend FFI::Library
    ffi_lib FFI::Library::LIBC
    typedef :int, :kern_return_t

    typedef :ulong_long, :memory_object_offset_t
    typedef :uint, :vm_inherit_t
    typedef :uint, :natural_t
    typedef :natural_t, :mach_msg_type_number_t
    typedef :natural_t, :mach_port_name_t
    typedef :mach_port_name_t, :mach_port_t
    typedef :mach_port_t, :vm_map_t
    typedef :mach_port_t, :task_t
    typedef :mach_port_t, :thread_act_t
    typedef :int, :vm_region_flavor_t
    typedef :int, :vm_prot_t
    typedef :int, :vm_behavior_t
    typedef :int, :policy_t
    typedef :int, :boolean_t
    typedef :int, :thread_state_flavor_t
    case FFI::Platform::LONG_SIZE
    when 64
      # ifdef __LP64__
      typedef :uintptr_t, :vm_size_t
      typedef :uintptr_t, :vm_offset_t
    when 32
      # else   /* __LP64__ */
      typedef :natural_t, :vm_size_t
      typedef :natural_t, :vm_offset_t
    else
      raise "Unsupported Platform"
    end
    
    typedef :vm_offset_t, :vm_address_t
    
    attach_function :getpid, [], :pid_t
    attach_function :ptrace, [:int, :pid_t, :ulong, :int], :int
    attach_function :wait, [:pointer], :pid_t
    attach_function :waitpid, [:pid_t, :pointer, :int], :pid_t
    attach_function :mach_task_self, [], :mach_port_t
    attach_function :task_for_pid, [:mach_port_name_t, :int, :pointer], :kern_return_t
    attach_function :task_threads, [:task_t, :pointer, :pointer], :kern_return_t
    attach_function :kill, [:pid_t, :int], :int
    attach_function :vm_read_overwrite, [:vm_map_t, :vm_address_t, :vm_size_t, :vm_address_t, :pointer], :kern_return_t
    attach_function :vm_write, [:vm_map_t, :vm_address_t, :vm_offset_t, :mach_msg_type_number_t], :kern_return_t
    attach_function :vm_protect, [:vm_map_t, :vm_address_t, :vm_size_t, :boolean_t, :vm_prot_t], :kern_return_t
    attach_function :vm_allocate, [:vm_map_t, :pointer, :vm_size_t, :int], :kern_return_t
    attach_function :vm_deallocate, [:vm_map_t, :vm_address_t, :vm_size_t], :kern_return_t
    attach_function :thread_resume, [:thread_act_t], :kern_return_t
    attach_function :thread_suspend, [:thread_act_t], :kern_return_t
    attach_function :task_suspend, [:int], :kern_return_t
    attach_function :task_resume, [:int], :kern_return_t
    attach_function :sysctl, [:pointer, :int, :pointer, :pointer, :pointer, :int], :int
    attach_function :execv, [:string, :pointer], :int
  end<commit_msg>fix bad FFI parameter reported by iZsh<commit_after>require 'ffi'

module Ragweed; end
module Ragweed::Wraposx

  module Libc
    extend FFI::Library
    ffi_lib FFI::Library::LIBC
    typedef :int, :kern_return_t

    typedef :ulong_long, :memory_object_offset_t
    typedef :uint, :vm_inherit_t
    typedef :uint, :natural_t
    typedef :natural_t, :mach_msg_type_number_t
    typedef :natural_t, :mach_port_name_t
    typedef :mach_port_name_t, :mach_port_t
    typedef :mach_port_t, :vm_map_t
    typedef :mach_port_t, :task_t
    typedef :mach_port_t, :thread_act_t
    typedef :int, :vm_region_flavor_t
    typedef :int, :vm_prot_t
    typedef :int, :vm_behavior_t
    typedef :int, :policy_t
    typedef :int, :boolean_t
    typedef :int, :thread_state_flavor_t
    case FFI::Platform::LONG_SIZE
    when 64
      # ifdef __LP64__
      typedef :uintptr_t, :vm_size_t
      typedef :uintptr_t, :vm_offset_t
    when 32
      # else   /* __LP64__ */
      typedef :natural_t, :vm_size_t
      typedef :natural_t, :vm_offset_t
    else
      raise "Unsupported Platform"
    end
    
    typedef :vm_offset_t, :vm_address_t
    
    attach_function :getpid, [], :pid_t
    attach_function :ptrace, [:int, :pid_t, :ulong, :int], :int
    attach_function :wait, [:pointer], :pid_t
    attach_function :waitpid, [:pid_t, :pointer, :int], :pid_t
    attach_function :mach_task_self, [], :mach_port_t
    attach_function :task_for_pid, [:mach_port_name_t, :int, :pointer], :kern_return_t
    attach_function :task_threads, [:task_t, :pointer, :pointer], :kern_return_t
    attach_function :kill, [:pid_t, :int], :int
    attach_function :vm_read_overwrite, [:vm_map_t, :vm_address_t, :vm_size_t, :pointer, :pointer], :kern_return_t
    attach_function :vm_write, [:vm_map_t, :vm_address_t, :vm_offset_t, :mach_msg_type_number_t], :kern_return_t
    attach_function :vm_protect, [:vm_map_t, :vm_address_t, :vm_size_t, :boolean_t, :vm_prot_t], :kern_return_t
    attach_function :vm_allocate, [:vm_map_t, :pointer, :vm_size_t, :int], :kern_return_t
    attach_function :vm_deallocate, [:vm_map_t, :vm_address_t, :vm_size_t], :kern_return_t
    attach_function :thread_resume, [:thread_act_t], :kern_return_t
    attach_function :thread_suspend, [:thread_act_t], :kern_return_t
    attach_function :task_suspend, [:int], :kern_return_t
    attach_function :task_resume, [:int], :kern_return_t
    attach_function :sysctl, [:pointer, :int, :pointer, :pointer, :pointer, :int], :int
    attach_function :execv, [:string, :pointer], :int
  end
{'fraction_non_alphanumeric': 0.11238622872971904, 'fraction_numerical': 0.0031658092599920855, 'mean_word_length': 4.72480181200453, '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': '5300066', 'n_tokens_mistral': 1968, 'n_tokens_neox': 1947, 'n_words': 401}